944,204 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2216
  • C++ RSS
Nov 9th, 2004
-1

program won't run

Expand Post »
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 <iostream.h>
#include<iomanip.h>

//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 ="<<length;
cout << "\n width="<<width;
cout << "\n depth="<<depth;
cout << "\n total surface area="<<surface;
cout << "\n cost="<<surface * PRICE_SQ << endl;

return 0;
}
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lost_c++_dude is offline Offline
6 posts
since Nov 2004
Nov 9th, 2004
0

Re: program won't run

Quote originally posted by lost_c++_dude ...
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 <iostream.h>
#include<iomanip.h>

//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 ="<<length;
cout << "\n width="<<width;
cout << "\n depth="<<depth;
cout << "\n total surface area="<<surface;
cout << "\n cost="<<surface * PRICE_SQ << endl;

return 0;
}
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
Reputation Points: 17
Solved Threads: 9
Posting Whiz in Training
frrossk is offline Offline
220 posts
since Sep 2004
Nov 9th, 2004
0

Re: program won't run

Quote originally posted by frrossk ...
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lost_c++_dude is offline Offline
6 posts
since Nov 2004
Nov 9th, 2004
0

Re: program won't run

>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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Nov 9th, 2004
0

Re: program won't run

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.
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in C++ Forum Timeline: Convert first character from lowercase to uppercase?
Next Thread in C++ Forum Timeline: need help with saving in ofstream, ifstream





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC