#include<iostream> #include<iomanip> using namespace std; int main() { //Declare
ID: 3612960 • Letter: #
Question
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
//Declare variables
char vehicleType;
double amountDue;
double numHours;
cout << fixed << showpoint <<setprecision(2);
cout << "This program computes a"
<< "parking charge."<< endl;
cout << "Enter vehicle type:"
<< "c for car, b for bus,"
<< "t for truck, and xfor"
<< "motorcycle: "<<endl;
cin >> vehicleType;
cout >> endl;
cout << "Enter number of hours parked:";
cin >> numHours;
cout << endl;
switch(vehicleType)
{
case 'c' :
amountDue = numHours * 3.00;
cout << "The amount due is:$" << amountDue;
break;
case 'b' :
amountDue = numHours * 10.00;
cout << "The amount due is:$" << amountDue;
break;
case 't' :
amountDue = numHours * 8.00;
cout << "The amount due is:$" << amountDue;
break;
case 'x' :
amountDue = numHours * 2.50;
cout << "The amount due is:$" << amountDue;
break;
default :
cout << "Invalid vehicletype." ;
}
return 0;
error C2784:'std::basic_istream<_Elem,_Traits> &std::operator>>(std::basic_istream<_Elem,_Traits> &,_Elem&)' : could not deduce template argument for'std::basic_istream<_Elem,_Traits> &' from'std::ostream'
Explanation / Answer
#include#includeusing namespace std;int main(){//Declare variableschar vehicleType;double amountDue;double numHours;coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.