I am trying to write this short program that will calculate, (1) the cost for hotel (45 a night), cost for gas (1.67 a gallon) and total cost. The car is going to be used for a total of 200 and it already 20 miles on it. I know that 200/20*1.67 is the correct formula but how would I get the visual 6.00C++ to recognize it.
Here is what I have so far:
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int num
int destination;
double total;
const double hotel = 45.00
cout<<"Welcome to Oscar Vacation Planner!\n"<<endl;
cout<<"Please enter destination distance"<<endl;
cin>> destination;
cout<<"Enter your cars mileage"<<endl;
cin>> mileage;
cout<<"Enter cost of gas per gallon"<<endl;
cin>> gas;
cout<<"How many days are you staying"<<endl;
total = hotel * 2;
total = destination * mileage /gas;
total = hotel * 2;
/*
gas 1.67
hotel 45.00
*/
cout<< fixed<<showpoint;
cout<<setprecision(2);
cout<<setw(20)<<"Total:";
cout<<setw(10)<<total<<endl;
return 0;
}