7:26Course
1
Assignment
Rλ
+
19. The notion of
20.
most closely describes the way a calling method is not
aware of the statements within a called method.
a.
abstraction
b. object-oriented
Programmers should strive to
a. increase coupling
b. increase cohesion
c.
implementation hiding
d. encapsulation
C.
both of the above
d. neither a nor b
Programming Exercises
1.
Create an IPO chart for each of the following methods:
2.
a. The method that calculates the amount owed on a restaurant check, includ-
ing tip
b. The method that calculates the cost to drive your car a mile
C. The method that calculates your annual medical expenses after the insurance
company has made its payments
a.
Create the logic for a program that calculates and displays the amount of
money you would have if you invested $5000 at 2 percent simple interest for
one year. Create a separate method to do the calculation and return the result
to be displayed.
b. Modify the program in Exercise 2a so that the main program prompts
the user for the amount of money and passes it to the interest-calculating
method.
c. Modify the program in Exercise 2b so that the main program also prompts
the user for the interest rate and passes both the amount of money and the
interest rate to the interest-calculating method.
Chapter 9 p. 415 Exercise 2a (only pseudocode is
required)
Hint: Once you have a workable algorithm, then it
becomes very easy.
Save and Close
Submit
49