Project Instructions Modify your code from Project 2 to make it modular. Instead of having one long main function that c

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Project Instructions Modify your code from Project 2 to make it modular. Instead of having one long main function that c

Post by answerhappygod »

Project Instructions
Modify your code from Project 2 to make it modular.
Instead of having one long main function that contains all thestatements necessary to solve the problem given in previousprojects, you must write several small functions that each solve aspecific part of the problem. These small functions should then beexecuted in the correct order to implement a complete solution.
The named constants you used in previous projects should now bemade global so you won't have to pass those values to anyfunction.
In addition to the main function, your code must include thespecified functions. These functions must be written exactly asspecified to avoid a major error penalty.
Make sure your program uses the values returned from yourfunctions. Any functions that need input to perform a task willhave to accept arguments. Global variables areprohibited.
Steps:
Function 1 – mainMenu
A void function that just displays the first menu when called.See Sample Run for format.
Function 2 – streamingSerivceMenu
A void function that just displays the streaming services whencalled.
Function 3 – distributionLabelMenu
A void function that displays the distribution label types whencalled.
Function 4– generateStreams
A function that accepts the distribution label type and returnsthe number of streams generated based on the guidelines in Project2.
Function 5– calculateEarnings
A function that accepts the streaming service type and thenumber of streams and returns the amount of money earned from thesong.
Function 6– calculateLabelEarnings
A function that accepts the distribution label type and theamount earned from the total songs streamed and then returns theamount the distribution label earned.
NOTE: All functions must be coded asinstructed above. Modifying the functions (meaning adding orremoving parameters, changing the return type of the function,etc…) will count as a major error (i.e., one major error deductionfor each function that is modified.)
Sample Run (user input enclosed in blocks)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply