Q2a) A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one liter of milk and the profit of each carton of milk vary from farm to farm. Write a program that prompts the user to enter: The total amount of milk produced in the morning. The cost of producing one liter of milk. The profit on each carton of milk. The program then outputs: The number of milk cartons needed to hold milk. Round your answer to the nearest integer. The cost of producing milk. The profit for producing milk.   Q2b) Summary You found an exciting summer job for five weeks. It pays, say, $15.50 per hour. Suppose that the total tax you pay on your summer job income is 14%. After paying the taxes, you spend 10% of your net income to buy new clothes and other accessories for the next school year and 1% to buy school supplies. After buying clothes and school supplies, you use 25% of the remaining money to buy savings bonds. For each dollar you spend to buy savings bonds, your parents spend $0.50 to buy additional savings bonds for you. Instructions Write a program that prompts the user to enter: The pay rate for an hour and the number of hours you worked each week. The program then outputs the following: Your income before and after taxes from your summer job. The money you spend on clothes and other accessories. The money you spend on school supplies. The money you spend to buy savings bonds. The money your parents spend to buy additional savings bonds for you.   Q2c) For each used car a salesperson sells, the commission is paid as follows: $20 plus 30% of the selling price in excess of the cost of the car. Typically, the minimum selling price of the car is the cost of the car plus $200 and the maximum selling price is the cost of the car and $2,000. Instructions Write a program that prompts the user to enter: Purchasing cost of the car The minimum to be added to the purchasing cost The maximum to be added to the purchasing cost Salesperson’s fixed commission Percentage of the commission The program should output: The minimum and maximum selling price of the car The salesperson’s commission range Since your program handles currency, make sure to use a data type that can store decimals.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter3: Input/output
Section: Chapter Questions
Problem 4PE: 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and...
icon
Related questions
Question

Q2a)

A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one liter of milk and the profit of each carton of milk vary from farm to farm.

Write a program that prompts the user to enter:

  1. The total amount of milk produced in the morning.

  2. The cost of producing one liter of milk.

  3. The profit on each carton of milk.

The program then outputs:

  1. The number of milk cartons needed to hold milk.

    • Round your answer to the nearest integer.
  2. The cost of producing milk.

  3. The profit for producing milk.

 

Q2b)

Summary

You found an exciting summer job for five weeks. It pays, say, $15.50 per hour. Suppose that the total tax you pay on your summer job income is 14%.

After paying the taxes, you spend 10% of your net income to buy new clothes and other accessories for the next school year and 1% to buy school supplies.

After buying clothes and school supplies, you use 25% of the remaining money to buy savings bonds. For each dollar you spend to buy savings bonds, your parents spend $0.50 to buy additional savings bonds for you.

Instructions

Write a program that prompts the user to enter:

  1. The pay rate for an hour and the number of hours you worked each week.

The program then outputs the following:

  1. Your income before and after taxes from your summer job.

  2. The money you spend on clothes and other accessories.

  3. The money you spend on school supplies.

  4. The money you spend to buy savings bonds.

  5. The money your parents spend to buy additional savings bonds for you.

 

Q2c)

For each used car a salesperson sells, the commission is paid as follows: $20 plus 30% of the selling price in excess of the cost of the car.

Typically, the minimum selling price of the car is the cost of the car plus $200 and the maximum selling price is the cost of the car and $2,000.

Instructions

Write a program that prompts the user to enter:

  1. Purchasing cost of the car
  2. The minimum to be added to the purchasing cost
  3. The maximum to be added to the purchasing cost
  4. Salesperson’s fixed commission
  5. Percentage of the commission

The program should output:

  1. The minimum and maximum selling price of the car
  2. The salesperson’s commission range

Since your program handles currency, make sure to use a data type that can store decimals.

Expert Solution
steps

Step by step

Solved in 6 steps with 3 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning