The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
I have having difficulty with part b of the assignment.
CIS*1500 W16 – Assignment #2Due: Friday February 12, 3pmWrite complete C programs for each problem and submit them separately in the dropboxesfor Assignment 2A and Assignment 2B respectively.Make sure you submit the .c fle,not the executable.Your programs must compile successfully with the command:gcc -Wall -std=c99 -lm yourfle.cFor both questions, assume that only INTEGER values are entered as input.(A)[15 marks]Is global warming real? To help answer this question, we want to studythe trend of annual rainfall in various locations. The amount of annual rainfall is measuredin centimetres (rounded to the nearest centimetre). However, the report will go directly toBarrack Obama, so the measurements need to be converted to inches (1cm = 0.3937 in).Write a program that will read as input the measurements for the past 5 years (enteredby user one at a time). It should then output the total rainfall back in inches rounded toone decimal place. Furthermore, theaverage amount o± rain±allshould be calculatedfor the 5 years (in inches) along with thestandard deviation.Bothvaluesshouldbereported to two decimal places. Finally, if the amount of rainfall is either strictly increasingor strictly decreasing year over year, then report an additional message stating “Barrack -global warming is for real!”.To calculate the standard deviation, includemath.hand use the formula:r15⇣(x1-avg)2+(x2-avg)2+(x3-avg)2+(x4-avg)2+(x5-avg)2⌘,wherex1,x2,x3,x4,x5are the 5 years of rainfall in inches, andavgis their average.For example, if the rainfall for the past 5 years in Guelph was 790, 777, 772, 762, 749respectively, then your program should output:In 2011, there was 311.0 inches of rainfall.In 2012, there was 305.9 inches of rainfall.In 2013, there was 303.9 inches of rainfall.In 2014, there was 300.0 inches of rainfall.In 2015, there was 294.9 inches of rainfall.The average rainfall was 303.15 inches, with standard deviation 5.45.Barrack - global warming is for real!1