Assignment 1: 2/35, 14/58 (textbook)
This assignment is due Tuesday January 19 11:15am-12:30pm in class.
Details of the assignment:
2/35: Problem 2, page 35, in your textbook.
Write a program that takes as input a number of kilometers, and displays
the corresponding number of nautical miles. You may rely on the following
items of information:
- A kilometer represents 1/10,000 of the distance between the North Pole
and the equator
- There are 90 degrees, containing 60 minutes of arc each, between the
North Pole and the equator
- A nautical mile is one minute of arc.
Hints: Note that this problem requires that you first come up with
a formula for a nautical mile expressed in kilometers. Once you have that
formula the program is exactly like the Fahrenheit to Centigrade
temperature conversion program discussed in class (page 15 of your text).
To find out the formula you may find the following questions useful:
- How many nautical miles from the North Pole to the equator if one
minute of an
arc is one nautical mile?
- How many kilometers from the North Pole to the equator (same distance)?
14/58: Problem 14, page 58, in your textbook.
During the summer before the academic year, the registrar's office must
enter new data for incoming freshmen. Design and implement a program that
displays a data entry form with the following labeled fields:
- last name
- first name
- middle initial
- class year (an integer)
- campus phone
When the user selects the "Display" button, the program should
display this information on several lines in a message box.
Hints: This is not much different from the vital statistics program
on the previous page in the textbook. It makes use of TextFields
however, and calls the GBFrame's messageBox method,
which will be explained Thursday in class.
If you have any questions please let us know.