-
January 28th, 2013, 02:29 PM
#1
noob Dev-C++ help. Need to calc area & perimeter of a rectangle (class proj).
I apologize for the stupid questions, but I have to have this submitted tonight and this is my first time and I'm over my head with this deadline looming tonight. I appreciate any and all help anyone could provide. I am using Dev-C++
Here is the assignment: Write a program that prompts the user to input the length of a rectangle and the width of a rectangle and then displays the rectangle's area and perimeter.
The program should be broken down in 3 parts:
1. Input the length and the width (two input statements)
2. Calculate the area & perimeter (results should be saved in variables
3. print results.
Format the output so the user can easily read the results. Use the tab escape so its easy to read.
---------------------------------------------------------------
So here's what I have so far. I have been stuck for two days ![Frown](images/smilies/frown.gif)
#include iostream
using namespace std;
int main ()
{
int double length;
int width;
int area;
int perimeter;
cout << enter the length of a rectangle: ";
cin >> length;
cout << enter the width of a rectangle: ";
cin >> width;
area = length * width;
cout << "The area of the retangle is << area << endl;
perimeter = length * 2 + width * 2;
cout << "The perimeter of the rectangle is << perimeter << endl;
---------------------------------------------------------------
I dont want to get a zero for not turning this in, I'll continue to try to figure this out, but man...all this is greek to me. Hopefully i can absorb some of this, to be able to pass this class.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|