| | |
program won't run
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2004
Posts: 6
Reputation:
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 <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;
}
//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;
}
•
•
•
•
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;
}
http://www.daniweb.com/techtalkforums/thread13391.html
•
•
Join Date: Nov 2004
Posts: 6
Reputation:
Solved Threads: 0
•
•
•
•
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.
![]() |
Similar Threads
- Make a VB Program run in the background? (VB.NET)
- A Program to run a file (C)
- Please correct the error in my program. When i run the program on turbo c++ 3,. (C++)
- My program will not run! (C++)
- VB program run in the Network (Visual Basic 4 / 5 / 6)
- Creating a program to run under various OS (Pascal and Delphi)
- Linker Error when program is run (Urgent help required Please") (C++)
- Getting an Older Program to Run on Windows XP (Windows tips 'n' tweaks)
Other Threads in the C++ Forum
- Previous Thread: Convert first character from lowercase to uppercase?
- Next Thread: need help with saving in ofstream, ifstream
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream input int integer java lib linux list loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





