954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Need help writing a program for length and with

I need help writing a simple program. My Declaration is: length, width, area and perimeter. My Input is length and width. The Calculations are: p=2*(l+w) and a=l*w and my[B] Output is p and a can anyone please help me write this program. I just started out doing this and I am very confused.

southernd0529
Newbie Poster
13 posts since Feb 2009
Reputation Points: 6
Solved Threads: 0
 

What code do you have done so far?

EDIT: if your answer is none... start here:

#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
     // Declare Length, width, area and perimeter

     // Display message about length to user
     // Get length from user

     // Display message about width to user
     // Get width from user

     // Calculate perim
     // Calculate area

     // Show perim to user
     // Show area to user

     return 0;
}
Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

thats the code im using but when it comes line 6 i dont know what to type

southernd0529
Newbie Poster
13 posts since Feb 2009
Reputation Points: 6
Solved Threads: 0
 

this is what i have so far:
// Devin Southern
// COSC 112 - Spring 2009
// Dr. Stone
// 2/9/2009
// this program will

#include
using namespace std;

int main()
{
//declaration section
integer length, width, area, perimeter;
then i dont know what to type after this line i know i have to display the message about length to the user but i dont know how to word it

southernd0529
Newbie Poster
13 posts since Feb 2009
Reputation Points: 6
Solved Threads: 0
 

Look Up Declaring Variables and
Basic I/O . That should get you on a roll.... you might even try this link for help . That first link... boy it's a doosey.

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You