ITEC 120
L01b: Relay times

Objectives

After successfully completing this lab you will be able to develop calculations with variables and constants and print the results of the calculations.

Assignment

Develop a program named Relay in a file named Relay.java. You should put your Relay.java file in a a new directory named L01b in your ITEC120 directory. Write header comments at the top of the file and create the class and the main method.

/**
  * Relay.java - prints a report about a 4x400m relay race.
  *
  * @author   <your name>
  * @version  <today's date>
  */
  public class Relay
  {
      public static void main (String[] args)
      {
      }
  }

You will write a program which will print some information about a 4x400m relay race. This is a track and field event where 4 runners each run 400m, sequentially, each handing off the baton to the next runner, for a total of 1600m. (1600m is slightly more than one mile.) Declare 9 constants in your program:

Declare two variables in your program:

Write a program that prints a report about the relay that was run by these 4 people. You make up the names and times for your program. Your program should calculate minutes and seconds.

Here is one possible output for this program:

Sue ran the first leg in 72 seconds.
Carla ran the second leg in 68 seconds.
Janet ran the third leg in 70 seconds.
Brenda ran the last leg in 67 seconds.

The 4x400m relay was run in 4 minutes and 37 seconds.

Submit Your Assignment

Your grade for this assignment is based on the correctness of your output and the proper use of constants and variables. When you are done testing your program, submit your source code file, Relay.java, to the L01b dropbox on D2L.