Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Need it in C++) Gatas ng Kalabaw, a dairy product company, hired you as a programmer. Currently, the company sells pasteurized milk and ice cream.

(Need it in C++) "Gatas ng Kalabaw", a dairy product company, hired you as a programmer. Currently, the company sells pasteurized milk and ice cream. For the meantime, pasteurized milk are packaged in a bottle; each bottle costs 15.25 pesos. Ice cream comes in half-gallon size only which is prized at 100.00 pesos. To attract more customers, the company gives a five percent discount (on milk purchase only) to customers who buy at least 10 bottles of milk. Also, customers who buy at least 3 cans of ice cream are given seven percent discount on their ice-cream purchase (discount not applicable to milk purchases). Your program should ask the customer the following information: the number of bottles of milk and the number of ice cream cans to purchase. Input zero if you will not purchase the product being offered. The output should be: total cost of milk purchase, total cost of ice cream purchase, and combined total of these items.

Your code should have the following functions: double totalCost(int milk, int icecream) - this function calculates and returns the total Cost of the transaction. Your program should follow the sample program interactions shown below:

Example #1:

How many bottles of milk will you purchase? Input: 0 How many cans of half-gallon ice cream will you purchase? Input: 4 Total cost of milk purchase: 0.00 pesos Total cost of ice cream purchase: 372.00 pesos Total cost : 372.00 pesos Example #2: How many bottles of milk will you purchase? Input: 20 How many cans of half-gallon ice cream will you purchase? Input: 2 Total cost of milk purchase: 289.75 pesos Total cost of ice cream purchase: 200.00 pesos Total cost : 489.75 pesos

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions

Question

Environmental education explain?

Answered: 1 week ago

Question

Scope of environmental science short brief ?

Answered: 1 week ago

Question

Ecology and economy ?

Answered: 1 week ago