Overload the average method of Exercise to accept four integer parameters and return their average.
Exercise
Software Development Activities
It would be nice if these activities, in this order, defined a step-by-step approachfor developing software. However, although they may seem to be sequential, theyare almost never completely linear in reality. They overlap and interact. Let’sdiscuss each development activity briefly.
Software requirements specify what a program must accomplish. They indicatethe tasks that a program should perform, not how it performs them. Often, requirements are expressed in a document called a functional specification.
We discussed in Chapter the basic premise that programming is really aboutproblem solving; we create a program to solve a particular problem. Requirementsare the clear expression of that problem. Until we truly know what problem weare trying to solve, we can’t actually solve it.
The person or group who wants a software product developed (the client) willoften provide an initial set of requirements. However, these initial requirementsare often incomplete, ambiguous, and perhaps even contradictory. The softwaredeveloper must work with the client to refine the requirements until all key decisionsabout what the system will do have been addressed.
Requirements often address user interface issues such as output format, screenlayouts, and graphical interface components. Essentially, the requirements establishthe characteristics that make the program useful for the end user. They may alsoapply constraints to your program, such as how fast a task must be performed.
A software design indicates how a program will accomplish its requirements. The design specifies the classes and objects needed in a program and defines howthey interact. It also specifies the relationships among the classes. Low-level designissues deal with how individual methods accomplish their tasks.
A civil engineer would never consider building a bridge without designing itfirst. The design of software is no less essential. Many problems that occur in softwareare directly attributable to a lack of good design effort. It has been showntime and again that the effort spent on the design of a program is well worth it, saving both time and money in the long run.
During software design, alternatives need to be considered andexplored. Often, the first attempt at a design is not the best solution. Fortunately, changes are relatively easy to make during the design stage.
Implementation is the process of writing the source code that willsolve the problem. More precisely, implementation is the act of translating thedesign into a particular programming language. Too many programmers focuson implementation exclusively when actually it should be the least creative of alldevelopment activities. The important decisions should be made when establishingthe requirements and creating the design.
Testing is the act of ensuring that a program will solve the intended problem given all of the constraints under which it must perform. Testing includes runninga program multiple times with various inputs and carefully scrutinizing theresults. But it means far more than that. We revisit the issues related to testing inSection 7.9.
Key concept
The effort put into design is both crucial and cost effective.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.