For which of the following would polymorphism not provide a clean solution?
a. A billing program where there is a variety of client types that are billed with different fee structures.
b. A maintenance log program where data for a variety of types of machines is collected and maintenance schedules are produced for each machine based on the data collected.
c. A program to compute a 5% savings account interest for a variety of clients.
d. An IRS program that maintains information on a variety of taxpayers and determines who to audit based on criteria for classes of taxpayers.
c. A program to compute a 5% savings account interest for a variety of clients. Because there is only one kind of calculation, there is no need for polymorphism.
You might also like to view...
In the figure above, which number refers to the Set the text color button?
A. 2 B. 3 C. 4 D. 5
Suppose an instruction function is f( n ) = n2 + 5. When considering time complexities, why isn’t the graph a full parabola?
A. n can’t be negative B. There is only a finite set of integers that can be used for n. C. All time complexities must be straight lines. D. n can only take on values to the right of the cross-over point
Write a program that reads in two integers and determines and prints whether the first is a multiple of the second. (Hint: Use the modulus operator.)
What will be an ideal response?
(Challenge) Repeat the previous project, but position the centers of the circles on a spiral. The center of each circle will depend on both an angle and a distance from the origin. A constant change in both the angle and the distance will result in a spiral pattern.
This application is an extension of the previous program to draw the circles on a spiral. Knowledge of converting polar coordinates to Cartesian coordinates is helpful.