CS 166 02 Program Assignment 06 Chapter 09

profilekittenj
 (Not rated)
 (Not rated)
Chat

  

Review the application

1. Copy the Chapter 09 folder from the I:\kopp\outbox\CS 166 02\Program Assignments and import the project named ch09_ex4_AreaAndPerimeter.

2. Open the Main class and review its code.

3. Run the application to make sure it works correctly.

Modify the application so it allows two entries on the same line

4. In the Main class, modify the code that gets the length and the width so it prompts the user to enter the length and width on the same line. Then, parse the string that’s entered by the user to get one String object for the length and another for the width.

5. Modify the code that displays the data for the Rectangle object so that it includes the length and width.

6. Run the application to make sure it works correctly. If the user enters 100 and 20, the data that’s printed to the console should look something like this:


Enter length and width: 100 20

Length: 100.0

Width: 20.0

Area: 2,000.000

Perimeter: 240.000

Add the following comments to the top of your source code:

· Name

· Class and Section (CS 166 02)

· Assignment (Chapter 09 Program)

· Due Date: (see above)

· Description of the program

What to turn in

1. Turn in this sheet with your name on it.

Copy the Chapter 09 folder into your folder in the I:\kopp\inbox\CS 166 02 folder. 

  • 7 years ago
CS 166 02 Program Assignment 06 Chapter 09
NOT RATED

Purchase the answer to view it

blurred-text