CIS 636 Spring 2003 Assignment 1 – Getting Warmed Up – IDE, Basic Java, not even OOP 100 points
Assigned: 01/27/2003
Due: 02/03/2003 at the start of class
You may work
individually or in pairs for this assignment. But all work must be the work of
the person/people whose name is on the code! If working in pairs, the
individual contributions should be relatively equal. One possibility is to work
together tonight, then finish separately (to avoid communication difficulties).
Main Assignment:
The National Weather Service has updated
its wind chill factor formula. See http://www.nws.noaa.gov/om/windchill/index.shtml and
http://www.usatoday.com/weather/resources/basics/windchill/wind-chill-formulas.htm.
This means that my Wind Chill
Factor applet is no longer correct.
Your current task is to write a simple Java Application to calculate
Wind Chill Factors for both the old and new formulas.
You will need to obtain from the user the current
temperature and wind speed. Then calculate the wind chill factors and display
the results (including temperature and wind speed and both wind chill
factors). The USA Today page above has
the new and old formulas. The NWS page
above has a chart of wind chill factors and an applet (?) that calculates new
and old values, so you can check your work.
I have made available to you two I/O classes, RedmondMsgIn,
and RedmondMsgOut, that take care of a lot of details of I/O. I suggest that you use dialog boxes for
input – provided in RedmondMsgIn class by readValid, and for output – provided
in RedmondMsgOut by display. Using
these will give you a little basic GUI style without many lines of code. They
will cause you some extra effort learning the IDE (working with multiple files
and packages) but it will be useful learning for later.
Hand in:
Miscellaneous:
·
You can get any of my code you need from the review
page of my WWW site.
·
You shouldn’t have to change anything in RedmondMsgIn
and RedmondMsgOut. The recommended methods make some simplifying assumptions,
since we haven’t covered exception handling yet. This means that some
exceptions will result if the user tries hard enough. No biggie at this point.
·
Valid temperatures are from –40 to 50 (wind chill is
undefined above 50 degrees). Valid wind speeds are from 3 to 105 (wind chills
are undefined for wind speed less than 3).
Choices that are invalid shouldn’t cause problems with the program.
·
MAKE SURE YOUR
PROGRAM WORKS! (i.e. more than just removing compile errors). Your program
needs to be able to handle any valid inputs, and catch invalid values of the
correct type (for now (until we cover exceptions), we won’t catch invalid
values that are the wrong type (e.g. letters where numbers are
needed)).
·
Put YOUR NAME, and
e-mail address in comments at the beginning of the program.
·
Remember: Indentation, meaningful variable names, and
meaningful comments. Weaknesses in any of these could result in points off. You MUST include comments that explain your
program in order to get full credit.