Question: please help This question concerns modularity. Consider a set of three functions/methods that do the following: The first one reads in a list of numbers

 please help This question concerns modularity. Consider a set of three

please help

This question concerns modularity. Consider a set of three functions/methods that do the following: The first one reads in a list of numbers from user input. The second one calculates the average of a list of numbers. The third one outputs to the screen. Note: the following questions ask you to write some code. However, you don't necessarily need to write the entire contents of the methods; just enough to illustrate the point. (a) Using code, show how the functions/methods might communicate with one another, using one or more global variables. State any reasonable assumptions you make. [4 marks] (b) Using code, show how the functions/methods could be combined into one, using a control flag. [4 marks) (c) Using code, show how the functions/methods could communicate without either a global variable or control flags. [4 marks] (d) Explain why approach (c) results in greater maintainability than either (a) or (b). [6 marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!