Overview:
Compare average monthly temperatures to the temperature collect for the
year specified. Store in a text file for each month whether there is a
warming, cooling, or normal trend.
A warming trend is apparent if the year being analyzed is three times
the standard deviation above the average temperature. Otherwise, if the
specified month is three standard deviation times below the average
temperature then there is a cooling trend. A Normal trends occurs when
the value falls within +- three times the standard deviation.
Standard deviation is a measurement of how much the values fluctuate
from measurement to measurement. These values are stored in a separate
file for each month. Use these values to determine the normal range of
temperatures.
Input Note:
Our program must open and read two files. The first file called
“sd.txt” contains the standard deviation calculated for each month. The
second called “temp.txt” contains two lists. The first is the average
temperatures and the second is the set temperatures being analyzed.
All file must reside in the working directory of the program and be
referenced relative to that location.
Input Format
Standard deviation data
Jan <sd>
Feb <sd>
Mar <sd>
Apr <sd>
May <sd>
Jun <sd>
Jul <sd>
Aug <sd>
Sep <sd>
Oct <sd>
Nov <sd>
Dec <sd>
Temperature Data
Jan <temp>
Feb <temp>
Mar <temp>
Apr <temp>
May <temp>
Jun <temp>
Jul <temp>
Aug <temp>
Sep <temp>
Oct <temp>
Nov <temp>
Dec <temp>
Year <year>
Jan <temp>
Feb <temp>
Mar <temp>
Apr <temp>
May <temp>
Jun <temp>
Jul <temp>
Aug <temp>
Sep <temp>
Oct <temp>
Nov <temp>
Dec <temp>
Sample Input:
From sd.txt
Jan 1.2
Feb 1.8
Mar 0.9
Apr 8
May 1.2
Jun 1.34
Jul 2
Aug 3
Sep 1.2
Oct 1.33
Nov 1.77
Dec 1.4
From Temp.txt
Jan 20
Feb 21
Mar 32
Apr 50
May 55
Jun 68
Jul 68
Aug 80
Sep 70
Oct 55
Nov 45
Dec 30
Year 2008
Jan 30
Feb 28
Mar 28
Apr 50
May 40
Jun 74
Jul 73
Aug 74
Sep 68
Oct 56
Nov 45
Dec 36

Comments
Do you own homework!!
FAIL

Google, "mean," and "deviation." So easy they teach it to second graders and third graders.

Comments
lols, third graders
You're mean -- stop your deviations from our standards of interpersonal conduct! :P

Google, "mean," and "deviation." So easy they teach it to second graders and third graders.

yeah. i need the code for C++ for this to work.

yeah. i need the code for C++ for this to work.

We realize that. You're not going to get it without some effort on your part. The post that mattwaab linked explains why.

This article has been dead for over six months. Start a new discussion instead.