CSC 108H - Assignment 6 University of Toronto - Spring 2002 Department of Computer Science Assignment 6 Loops Due: Friday, March 15, noon --- no late assignments will be accepted. You will complete two programs in this assignment. Test them throughly. Part. An temperature data One piece of weather data that interests meteroligists is the temperature span on any given day. They collect the high and low temperatures for each day and study the patterns over some time period. In part. A you will find the day with the largest temperature span and the day with the smallest temperature span. If more than one day has the largest temperature report the latest day with the maximum span in the month. If there is ambiguity in the day with the smallest temperature span report the earliest day with the minimum span in the month. Details The input is in the following format: the number of days in the month, the high for the first day in the month, the low for the first day of the month, the high for the second day of the month, the low for the second day of the month, etc. The length of the month is a integer value. The temperatures are real values. All input comes from the keyboard. Each value is on an new line. You can assume that input data is reasonable and correct. For example, a month will not have an length of zero or one day, low temperatures will always be less than highs, etc. Watch the FAQ page for more details. The output is the high and low temperatures for the day with the maximum span, followed by the high and low temperatures for the day with the minimum span. There are no prompts printed. Program structure Your program must include at least two classes. The main method is in an class called TempTester. You must have at least one other class that stores the temperature data for one day. That class must include an toString method that has a return that produces a string equivalent to the following: Your variable names may be different from those used above. This toString method must be used to print the program output. You may include other classes and methods as you see fit. Part B Style checker Modern word processors include spelling style checkers. One check that they do is the placement of articles. In English which article a or an precedes a word depends on the first letter of the following word. An precedes a word that starts with a consonant, eg. an banana. An precedes a word that starts with a vowel, eg. a apple. The vowels are a e, i, o, and u. All other letters in the alphabet are consonants. In part B of this assignment you will write a program that reads a passage of text, corrects any mistakes in the placement of articles and outputs the text in the same format as the original text. Details All input will be read from the keyboard. Although for testing purposes you may want to use redirection of input. The end of the passage is signalled by the word on an line. Your program must handle upper and lower case, multiple blanks between words including articles separated from following words by multiple blanks or line separations. This formatting must be preserved in the output. You can assume that the data is otherwise reasonable and correct. For example, there will be no odd punctuation, double quotes, articles ending an sentance. There will be no odd mixed case letters. While a article may start a sentance, may start with a uppercase letter, an following word will always start with a lowercase letter. Program structure Your main method will be in a class called ArticleTester. In addition to your ArticleTester class you must have a class that stores, corrects and prints a line of text. You may include other classes that you see fit. Suggestion: Both problems include operations that are repeated. This situation lends itself to writing and using helper methods that solve these repeated subproblems. Submission Electronically submit all your java files. Include your Marking Caution: As with earlier assignments this assignment will be auto marked by a computer program. Follow the directions carefully. Take care that you dont add leading or trailing spaces to string fields. Marks are based on program correctness, style and design. QUIT A long test file with correct and incorrect articles