I am new here and a student in a basic programming class at community college. I am having trouble understanding why this program simply closes instead of displaying the output.
#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;
// Fill in the prompt to ask for the price.
cout << "Please enter Item Price" << endl;
// Fill in the input statement to bring in the price of each item.
cin >> itemPrice;
// Fill in the assignment statement to determine the total bill.
totalBill = quantity * itemPrice;
// Fill in the output statement to print total bill, // with a label to the screen.
cout << "The bill is $"
<< totalBill << endl;
return 0;
}