# Some Simple Code

• 02-20-2010
YoelWarda
Some Simple Code
Didn't add details. Totally common sense program.

Code:

```#include <iostream> #include <windows.h> using namespace std; int main() { double mpg; double miles; double costgas; double extra;         cout<<"Welcome to the Trip Cost Calculator.\n\n";         Sleep(1000);         while(1){                 cout<<"\n\nEnter the miles per gallon your car goes on: ";                 cin>>mpg;                 Sleep(1000);                         cout<<"\n\nEnter the amount of miles you wish to venture during your trip: ";                         cin>>miles;                         Sleep(1000);                                 cout<<"\n\nThe miles you wish to venture are "<<miles<<" on a car that goes "<<mpg<<" miles per gallon.\n\n";                                 Sleep(1000);                                         cout<<"\n\nEnter the cost of each gallon of gas: ";                                         cin>>costgas;                                         Sleep(1000); cout<<"The miles you wish to venture are "<<miles<<" on a car that goes "<<mpg<<" miles per gallon."<<" The total cost of the trip will be "<<((miles/mpg)*costgas)<<" dollars before extra expenses.\n\n"; Sleep(1000); cout<<"Enter the extra expenses you will encounter during the trip: "; cin>>extra; Sleep(1000); cout<<"\n\nThe total cost will be "<<((miles/mpg)*costgas)+extra<<" dollars. Hopefully, this amount is very low and you will have lots of fun at your destination! Have fun!\n\n";         }         }```
By the way, I didn't use strings due to the fact that this is meant to be a learning-program.
• 02-20-2010
YoelWarda
Bunch of updates on it for more user-friendly use.
• 02-20-2010
What? Is there supposed to be a question you're asking? Or are you trying to make a "tutorial"-type thing?
• 02-20-2010
cpjust
What's with the crazy indentation and lack of spaces?
• 02-21-2010
iMalc
Code:

`int answer = 42;`
• 02-21-2010
rogster001
Meaning of life
Perhaps google douglas adams 42 may serve to explain...? Edit.. O i see the op did not post answer equals 42, haha nice...
• 02-21-2010
Dae
Quote:

Originally Posted by iMalc
Code:

`int answer = 42;`