+ 1
What's wrong with this code? ... please help
#include <iostream> #include <iomanip> using namespace std; int main() { int quantity; // contains the amount of items purchased float itemPrice; // contains the price of each item float totalBill; // contains the total bill. cout << setprecision(2) << fixed << showpoint; //formatted output cout << "Please input the number of items bought" << endl; cin >> quantity; cout >> "Please input the price" << endl; cin >> itemPrice; totalBill = quantity * itemPrice; cout >> "The total Bill is " >> totalBill; return 0 }
1 Odpowiedź
+ 3
cout << "Please input the price" << endl;
cout << "The total Bill is "<<totalBill<<endl;
also in the return statement, you missed ";“.