COSC 120
Programing Assignment #1

DESCRIPTION: Produce a summary of temperatures for a month. It should print the day and the temperature for each temperature that is contained in the input file. It will also show any days in the sequence that does not have a temperature by producing asterisks as the temperature for any missing day. It will give a total of hot days (days with temperatures greater than or equal to 85), a total of pleasant days (days with temperatures greater than or equal to 60 but less than 85) and a total of cold days (days with temperatures less than 60). Finally it will give an average temperature for the month of recorded days.

Clarification: You can assume that the days are in ascending order. The input file will include 2 values per line. The first value is an integer that indicates the day. The second value is a floating point that indicates the temperature for that day. Results are printed to an output file.

SAMPLE INPUT:
3           90.4
5           81.2
8          58.4
10       62.5
11       71.4
14       66.1
15       69.0

SAMPLE OUTPUT

Day Temperature
___________________

3      90.4
4      *****
5      81.2
6      *****
7      *****
8      58.4
9      *****
10     62.5
11     71.4
12     *****
13     *****
14     66.1
15     69.0

The number of hot days = 1
The number of pleasant days = 5
The number of cold days = 1

The average temperature is 71.3

I. You must develop an Algorithm that includes the following.

    A. First section---Sample Input/Output. The specs give you  one sample I/O. You should include at least 1 more

    B. Second section includes a Variable List
    1. Input Variables
    2. Output Variables
    3. Other Variables (if necessary)

    C. Third section is a Tree Structure (This section is the only section that does not have to use a word processor)

    D. Fourth Section is the algorithm coming from the tree structure. It should use generic language and NOT C++ specific code.
 

II. You must write the program so that it runs properly.

A. Heading comments
    1. Programmers name
    2. Assignment number
    3. Class and Section
    4. Date
    5. Description of the program including input and output.
    6. Any assumptions that have been made

B. List of libraries

C. Object and Constant declarations

D. Body of the program that is well documented with appropriate comments about the logic of the program.
 

See Appendix C in your notes.

Sample Sessions
Sample Session # 1

SAMPLE INPUT:
1 84.4
2 80.1
3 79.2
8 73.0
9 85.4
10 86.1
11 82.2
15 80.0
17 78.2

SAMPLE OUTPUT

Day Temperature
___________________

1      84.4
2      80.1
3      79.2
4      *****
5      *****
6      *****
7      *****
8      73.0
9      85.4
10     86.1
11     82.2
12     *****
13     *****
14     *****
15     80.0
16     *****
17     78.2
 

The number of hot days = 2
The number of pleasant days = 7
The number of cold days = 0

The average temperature is  80.95
 

SAMPLE SESSION # 2

SAMPLE INPUT:
3 90.4
5 81.2
8 58.4
10 62.5
11 71.4
14 66.1
15 69.0

SAMPLE OUTPUT

Day Temperature
___________________

3      90.4
4      *****
5      81.2
6      *****
7      *****
8      58.4
9      *****
10     62.5
11     71.4
12     *****
13     *****
14     66.1
15     69.0

The number of hot days = 1
The number of pleasant days = 5
The number of cold days = 1

The average temperature is 71.3