Modify your code from Project 2 to make it modular. Instead of having one long main function that contains all the state

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

Modify your code from Project 2 to make it modular. Instead of having one long main function that contains all the state

Post by answerhappygod »

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.Thenamed constants you used in previous projects should now be madeglobal so you won't have to pass those values to any function.Inaddition to the main function, your code must include the specifiedfunctions. These functions must be written exactly as specified toavoid a major error penalty.Make sure your program uses the valuesreturned from your functions. Any functions that need input toperform a task will have to accept arguments. Globalvariables are prohibited.
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 displaysthe distribution label types when called.Function
4– generateStreams.A function that accepts the distributionlabel type and returns the number of streams generated based on theguidelines in Project 2.
Function 5– calculateEarnings A function that accepts thestreaming service type and the number of streams and returns theamount of money earned from the song.
Function 6– calculateLabelEarningsA function that accepts thedistribution label type and the amount earned from the total songsstreamed and then returns the amount the distribution labelearned.
Project 2 code.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply