So I'm trying to write into a variable in two different set arguments using this code, but it's not allowing me to enter the value for the 2nd cin.
#include<iostream>
using namespace std;
int main()
{
int T1,T2,T3,D,car_type;
double total;
cout<<"Please enter the values for T1 T2 T3 D: ";
cin>>T1,T2,T3,D;
cout<<endl;
cout<<"Please Choose a Car where 1 = Honda, 2 = Toyota, 3 = Mercedes: ";
cin>>car_type;
if (car_type = 1)
{
total = T1*D;
cout<<"The cost of a full tank for a Honda is "<<total<<" Dirhams.."<<endl;
}/* else
if (car_type = 2)
{
total = T2*D;
cout<<"The cost of a full tank for a Toyota is "<<total<<" Dirhams.."<<endl;
} else
if (car_type = 3)
{
total = T3*D;
cout<<"The cost of a full tank for a Mercedes is "<<total<<" Dirhams.."<<endl;
} */
}
Can you please tell me where I'm going wrong?