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

program won't run

I've tried everything but this program won't run. If I plug in numbers for length, width, and depth it won't tell me the cost to resurface. Any suggestions?

//prb01-1.cpp
//This program calculates the total surface area of a pool and the cost to resurface it

#include
#include

//using namespace std;

int main()
{

int depth,length,width,total;
int surface;
const double PRICE_SQ = 3;
//obtain input data

cout<<"\nEnter the length in feet";
cin>>length;
cout<<"\nEnter width in feet";
cin>>width;
cout<<"\nEnter depth in feet";
cin>>depth;

//Do the calculations
surface=2*depth*(length+width)+length*width;

//Display the results
cout << "\n length ="<

lost_c++_dude
Newbie Poster
6 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

I've tried everything but this program won't run. If I plug in numbers for length, width, and depth it won't tell me the cost to resurface. Any suggestions?

//prb01-1.cpp //This program calculates the total surface area of a pool and the cost to resurface it

#include #include

//using namespace std;

int main() { int depth,length,width,total; int surface; const double PRICE_SQ = 3; //obtain input data

cout<<"\nEnter the length in feet"; cin>>length; cout<<"\nEnter width in feet"; cin>>width; cout<<"\nEnter depth in feet"; cin>>depth;

//Do the calculations surface=2*depth*(length+width)+length*width;

//Display the results cout << "\n length ="<http://www.daniweb.com/techtalkforums/thread13391.html

frrossk
Posting Whiz in Training
220 posts since Sep 2004
Reputation Points: 17
Solved Threads: 9
 
You posted exactly the same problem a few days ago, and there was an answer with an working example. Did you take a look on it? http://www.daniweb.com/techtalkforums/thread13391.html


It didn't work.

lost_c++_dude
Newbie Poster
6 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

>It didn't work.
Then you didn't do it right. Try again and don't post the same question in a new thread again. If it still doesn't work, tell us exactly how it doesn't work as opposed to how you think it should work.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

Now closing this thread. Please keep the discussion going in the same thread as before. If you need me to merge these two threads, please let me know.

alc6379
Cookie... That's it
Team Colleague
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You