Problem

For Exercises 15 through 28, use the incremental development methodology to implement th...

For Exercises 15 through 28, use the incremental development methodology to implement the program. Design a visually appealing GUI with Swing components and layout managers. For each exercise, identify the program tasks, create a design document with class descriptions, and draw the program diagram. Map out the development steps at the start. Present any design alternatives and justify your selection. Be sure to perform adequate testing at the end of each development step.

Modify the mortgage table program of Exercise 30 in Chapter 6. Add this menu

to the program. When the user selects the menu choice New Table, the program opens another frame in which the user can enter three input values. The input frame should look something like this:

If the user clicks on the Compute button and the three input values are valid, generate a mortgage table. Use the OutputBox class from Exercise 5 to display the mortgage table. If the input values are invalid, then print out an appropriate error message. Decide on the range of valid values for the loan amount, interest rate, and loan period. When the user selects the menu choice About . . . , describe the purpose of the program by using another frame. You should create only one input frame, but may decide to use more than one OutputBox frame so you can see multiple loan tables at once.

Reference Exercise 30 in chapter 6 and 5.

Instead of dropping a watermelon from a building, let’s shoot it from a cannon and compute its projectile. The (x, y) coordinates of a watermelon at time t are

where g is the acceleration of gravity, V is the initial velocity, and (alpha) is the initial angle. The acceleration of gravity on earth is 9.8 m/s2.

Write an application that inputs an initial velocity V (m/s) and an initial angle alpha (degrees) and computes the projectile of a watermelon cannon ball. The program should repeat the computation until the user wants to quit. The program outputs the (x, y) oordinate value for every second, that is, t = 0, 1, 2, and so forth. The program stops the output when the y value becomes 0 or less. To use the cos and sin methods of the Math class, don’t forget that you have to convert the input angle given in degrees to radians. You can convert a degree to equivalent radians by using the following

or calling the toRadians method of the Math class. Note: Air resistance is not considered in the formula. Also, we assumed the watermelon will not get smashed upon firing.

Define an OutputBox class as a subclass of JFrame. The OutputBox class provides the functionality of System.out (PrintStream) by supporting these methods:

public void println(String line)

public void print(String text)

The OutputBox class contains one JTextArea object. Do not use absolute positioning. Use the default layout and add a JScrollPane that wraps the JTextArea object to the content pane.

Step-by-Step Solution

Request Professional Solution

Request Solution!

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.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 14