Question: Complete the program to achieve the functionality. You are writing a program for a store that wants to give 10% discount on a bill of

Complete the program to achieve the functionality.

You are writing a program for a store that wants to give 10% discount on a bill of 100 CAD or more. It works as follows, First take input from the user, each input will represent the price of an item. Keep a count of the items the user is giving. The user will stop the input of price by pressing any random character. Once you have the input from the user, you want to print the total price for the user. If the total price is less than 100 then the price will be as it is. If the total price is 100CAD or more then apply a 10% discount and display the total price. Example1,

Welcome to the store. Enter the price of item: 20 Enter the price of item: 20 Enter the price of item: 15 Enter the price of item: 20 Enter the price of item: h Your total price is 75CAD

Example 2,

Welcome to the store. Enter the price of item: 35 Enter the price of item: 30 Enter the price of item: 20 Enter the price of item: 20 Enter the price of item: 10 Enter the price of item: k Your total price is 103.5CAD

Note: Please do not change the given code, else marks will be deducted. You only have to write your code within the space between the comments.

#include using namespace std;

int main() { float total = 0; float itemPrice = 0; cout<<"Welcome to the store."<

//END of your code if(total >= 100){ //Write the code below this line

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!