You have been hired by a local smoothie shop to a program that will calculate the cost of a smoothie order. The shop sells four types of smoothies in three different sizes: Small (20 oz), Medium (32 oz) and Large (40 oz). Your program should use a menu for the type of smoothie and a second menu for the smoothie size. Calculate the total cost of the order including tax and display a bill for the smoothie. See the Sample Output. The sales tax rate is 4.5%.  Use named constants to hold the cost per ounce of each of the products and the sales tax rate. Use the constants in your calculations and wherever else they are appropriate in your program.   Product                  Cost per Ounce      Banana                              $0.62 Strawberry                         $0.60 Mango                               $0.48  Blueberry                           $0.57 Project 3 is a continuation of Projects 1 and 2. You will modify your code from Project 2 to make the program modular for this part of the project. Instead of having one long main function that contains all the statements necessary to solve the problem given in previous projects, you must several smaller functions that each solve a specific part of the problem. These small functions should then be executed correctly to implement a complete solution. The named constants you used in previous projects should now be made global so you won't have to pass those values to any function. In addition to the main function, your code must include the specified functions. These functions must be exactly as specified to avoid a major error penalty (1 major error per incorrect function). Make sure your program uses the values returned from your functions. Any functions that need input to perform a task will have to accept arguments. Global variables are prohibited. Steps: Make all of your named constants global. Define prototypes and define the following functions: Function 1 - displayStartMenu A void function that only displays the first menu. See Sample Output for format. Function 2 - determineCostPerOz A double returning function that accepts the user's menu choice for type of smoothie and returns the price per ounce. Function 3 - determineNumberOunces An integer returning function that accepts the user's menu choice for size of smoothie and returns the number of ounces. Function 4- calcSmoothieSubtotal A double returning function that accepts the price per ounce and the number of ounces purchased and returns the price of the smoothie. Function 5- calcSalesTax A double returning function that ONLY accepts the price of the smoothie and returns the sales tax. Function 6- calcCostBill A double method that accepts the price of the smoothie and the sales tax and returns the total amount owed.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

You have been hired by a local smoothie shop to a program that will calculate the cost of a smoothie order. The shop sells four types of smoothies in three different sizes: Small (20 oz), Medium (32 oz) and Large (40 oz). Your program should use a menu for the type of smoothie and a second menu for the smoothie size. Calculate the total cost of the order including tax and display a bill for the smoothie. See the Sample Output. The sales tax rate is 4.5%.  Use named constants to hold the cost per ounce of each of the products and the sales tax rate. Use the constants in your calculations and wherever else they are appropriate in your program.

 

Product                  Cost per Ounce     
Banana                              $0.62
Strawberry                         $0.60

Mango                               $0.48 

Blueberry                           $0.57

Project 3 is a continuation of Projects 1 and 2. You will modify your code from Project 2 to make the program modular for this part of the project.

Instead of having one long main function that contains all the statements necessary to solve the problem given in previous projects, you must several smaller functions that each solve a specific part of the problem. These small functions should then be executed correctly to implement a complete solution.

The named constants you used in previous projects should now be made global so you won't have to pass those values to any function.

In addition to the main function, your code must include the specified functions. These functions must be exactly as specified to avoid a major error penalty (1 major error per incorrect function).

Make sure your program uses the values returned from your functions. Any functions that need input to perform a task will have to accept arguments. Global variables are prohibited.

Steps:

  1. Make all of your named constants global.
  2. Define prototypes and define the following functions:

Function 1 - displayStartMenu

A void function that only displays the first menu. See Sample Output for format.

Function 2 - determineCostPerOz

A double returning function that accepts the user's menu choice for type of smoothie and returns the price per ounce.

Function 3 - determineNumberOunces

An integer returning function that accepts the user's menu choice for size of smoothie and returns the number of ounces.

Function 4- calcSmoothieSubtotal

A double returning function that accepts the price per ounce and the number of ounces purchased and returns the price of the smoothie.

Function 5- calcSalesTax

A double returning function that ONLY accepts the price of the smoothie and returns the sales tax.

Function 6- calcCostBill

A double method that accepts the price of the smoothie and the sales tax and returns the total amount owed.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Types of Expressions
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education