Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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, eg write cout value; instead of cout
#include
using namespace std;
int main
declare variables for three item names
string item;
declare variable named item
declare variable named item
declare variables for three item prices
float price;
declare variable named price
declare variable named price
cout "Item : ;
cout "Price : ;
cout "Item : ;
cout "Price : ;
cout "Item : ;
cout "Price : ;
float total
; compute sum in order of prices and
cout "Total:
;
return statement
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started