Question: Problem Statement Write a program to compute a bill. It prompts the user three times to enter an item name and a price. The price

Problem Statement
Write a program to compute a bill. It prompts the user three times to enter an item name and a price. The price must be stored as floating point value. It then computes the total and outputs it to the console.
WARNING: Be sure to add a space before and after each operator, e.g. write cout << value; instead of cout<
#include
using namespace std;
int main()
{
// declare variables for three item names
string item1;
// declare variable named item2
// declare variable named item3
// declare variables for three item prices
float price1;
// declare variable named price2
// declare variable named price3
cout << "Item 1: ";
cout << "Price 1: ";
cout << "Item 2: ";
cout << "Price 2: ";
cout << "Item 3: ";
cout << "Price 3: ";
float total =
; // compute sum in order of prices 1,2, and 3
cout << "Total: "<<
;
// return statement
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!