Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3042

#define not working with my input

$
0
0
Code isn't fully complete but I don't want to continue when my #define isn't even working, what am I doing wrong here? Please help, and go easy on me, this is my first code ever. Thanks!

#define PI 3.14159
#include <iostream>
using namespace std;

int main()

{

int answer;
cout << "The area of a circle is" <<PI>> "* radius * radius"<<endl; //This line is a calculation and cannot be done until you read in the radius from the user, i.e. you cannot do a calculation until

//Ask the user for the radius of the pie in inches.
cout << "What is the radius of the pie in inches?" << endl;
//read in the radius

//Ask the user for the length of the shelf.
cout << "What is the length of the shelf?" <<endl;
//readin the length

//Ask the user for the width of the shelf.
cout << "What is the width of the shelf?" <<endl;
//read in the width

//Calculate the area of the pie.

//Calculate the area of the shelf.
//ex: sum = num1 + num2; example of a sum calculation

//Calculate the total number of pies that can fit on the shelf.
cout << "What is the total number of pies that can fit on the shelf?" <<endl; //This is not an output statement this is also a calculation, your answer which should be the area of your shelves
//divided by the area of your pies
system("pause");
//Display a message telling the user how many pies can fit on the shelf
cout << "The number of pies that can fit on the shelf is" << answer << endl;
return 0;
}

Viewing all articles
Browse latest Browse all 3042

Trending Articles