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
odonal01 -2 Newbie Poster
Rashakil Fol commented: FAIL -2
mattwaab commented: Do you own homework!! +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague
MosaicFuneral 812 Nearly a Posting Virtuoso
Rashakil Fol commented: You're mean -- stop your deviations from our standards of interpersonal conduct! :P +8
mattwaab commented: lols, third graders +1
mattwaab 20 Newbie Poster
odonal01 -2 Newbie Poster
VernonDozier 2,218 Posting Expert Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.