ITEC 120 LAB 3  

Lab must be completed and reviewed by Peer Instructor on Wed, Jan 21 during lab class and no later than the first 10 minutes of lab class on Fri, Jan 23.


In this lab you'll create a new Java program that will convert miles to kilometers.

Sample run:

Program outputs: How many miles?
User inputs: 5
Program outputs: 5 miles is 8.04675 kilometers.

You will use the Keyboard class for this project. Download it and put it in a folder called cs1, which needs to be in the same directory as your .java file. Be sure to put the line:

import cs1.Keyboard;

at the top of your program (after the header documentation but before the class header).

Use one constant in your program. What value should it hold? How many variables will you need? What type will they be? What are good names for your variables?