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 Output is p and a can anyone please help me write this program. I just started out doing this and I am very confused.

8 Years
Discussion Span
Last Post by Comatose

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;

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

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.