program won't run

Please support our C++ advertiser: Intel Parallel Studio Home
Closed Thread

Join Date: Nov 2004
Posts: 6
Reputation: lost_c++_dude is an unknown quantity at this point 
Solved Threads: 0
lost_c++_dude lost_c++_dude is offline Offline
Newbie Poster

program won't run

 
-1
  #1
Nov 9th, 2004
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;
}
Quick reply to this message  
Join Date: Sep 2004
Posts: 220
Reputation: frrossk is an unknown quantity at this point 
Solved Threads: 9
frrossk's Avatar
frrossk frrossk is offline Offline
Posting Whiz in Training

Re: program won't run

 
0
  #2
Nov 9th, 2004
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
Quick reply to this message  
Join Date: Nov 2004
Posts: 6
Reputation: lost_c++_dude is an unknown quantity at this point 
Solved Threads: 0
lost_c++_dude lost_c++_dude is offline Offline
Newbie Poster

Re: program won't run

 
0
  #3
Nov 9th, 2004
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.
Quick reply to this message  
Join Date: Sep 2004
Posts: 7,771
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 743
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: program won't run

 
0
  #4
Nov 9th, 2004
>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.
I'm here to prove you wrong.
Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: program won't run

 
0
  #5
Nov 9th, 2004
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.
Alex Cavnar, aka alc6379
Quick reply to this message  
Closed Thread

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC