Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago