Source: Mr. Sanford, BCC CIS73222.doc Lab Assignment 2 Due 09-28-09 Object Oriented Java Programming This week we are going to write one executable application program that we will use to research how to declare variables and write arithmetic expressions to solve common problems. We will not be taking any data in from the keyboard because we have not resolved how to do that yet. The input for all of our research will have to be in the form of initialized variables, that we “set” with some pre-determined value or with previously declared variables that have been assigned a value (note the difference) See “Calculations with Variables” in the Sample List on the class web site, for a good reference..…... Note that all output should contain titles. Write only one executable Java application file for this assignment that will: 1. Declare an integer named fahrenheit and initialize it to 96. Display it. Display the corresponding Centigrade temperature for fahrenheit. 2. Declare an int named miles and a double named gallons. Assign 496 to miles and 22.88 to gallons. Display miles and gallons. Given that these are the values from a recent trip that we took, display the miles per gallons for the trip. 3. Using the miles per gallon that we calculated for the previous trip, display the estimated gallons required for our upcoming trip of 843 miles. 4. Bill works 43 hours for a base rate of $18.75 per hour. Display the hours worked, the base rate per hour, and the gross pay, assuming he gets paid time and one-half for overtime over 40 hours per week. 5. If Jason buys four tires for 67.95 each and receives a 15% discount, display the cost of the tires including the discount. Display the total amount of the purchase including the 5% state income tax. ********************************************************************************************************************************* Notes: 1. Label the end of all classes, methods, and blocks with a comment. 2. Line up the beginning brace { and ending brace } vertically for each block. (i.e. for each class, method, and block) 3. Indent all code between the beginning and ending braces so that the lineup of braces can be easily observed. 4. Include comments at the beginning of every .java source file with the assignment number, author, date due, and an essay (with paragraphs) at the start of the file describing the functionality of each class as well as how each class “works”. User instructions should also be provided. Are there comments reference important or complex syntax? 5. Insert dividers/separators (i.e. a line of dashes or a line of asterisks) between each method and class. 6. Capture your test results and paste them into the end of your .java source class file as comments. 7. Submit an electronic copy of your .java source class files (with the test results “pasted in” as comments) for credit. Note that all submissions should be made as attachments to an email, and sent to the instructor with the following subject line: CIS73 Lab x where x = the lab assignment number. Note that the subject line is case sensitive. 8. Note that assignments should be submitted on or before the due date for full credit per the course policies. 9. Note once again that all duplicate .java files that are submitted for a grade will NOT be graded. 10. If you are having problems that you and your classmates cannot resolve, you should attempt to resolve them in our lab sessions each week, or make an appointment to meet with me. If all else fails then get back to me via email....We care about the students that care!