Average temperature for the month in new york city

Assignment Help C/C++ Programming
Reference no: EM13930215

1. In a Matlab text by Gilat a problem presents the relationship between temperatures in New York City and Anchorage, Alaska during the month of January, 2001. According to the U.S. National Oceanic Atmospheric Administration, the January Fahrenheit high temperatures for New York City and Anchorage Alaska were:


Date

New York City Temperature

(degrees Fahrenheit)

Anchorage Temperature

(degrees Fahrenheit)

1

31

37

2

26

24

3

30

38

4

33

25

5

33

21

6

29

28

7

41

46

8

41

37

9

34

36

10

33

20

11

45

24

12

42

31

13

36

34

14

39

40

15

37

43

16

45

36

17

43

34

18

36

41

19

41

42

20

37

35

21

32

38

22

32

36

23

35

35

24

42

33

25

38

42

26

33

42

27

40

37

28

37

26

29

36

20

30

51

25

31

50

31

Create a new project in Visual Studio. Then create a data file in Notepad with two columns, with New York City temperatures in the column on the left and corresponding Anchorage temperatures in the column on the right. Do not include column labels or dates. Save the file in the project folder. In the program check to make sure the file opened successfully. Then write a program to read in the 31 sets of temperature data using a for or while loop. If using a for loop, add the number of lines at the top of the data file and read in the number of lines from the file. If using a while loop, use a sentinel (-999 at the end of the data) or end of file method, eg,
while( (fscanf(fpIn,"%d%d", &NYC, &ANC)) ==2) since there are two conversions per line.

As values are read in the loop calculate the necessary sums and values for the following (Do not determine any of the values merely by inspection):

The average temperature for the month in New York City and the average temperature for the month in Anchorage.
The number of days the temperature in Anchorage was greater than the temperature in New York City.
The high temperature and low temperature in January for New York City.
The number of days the temperature in Anchorage was equal to or below 32 degrees.

Write the averages, counts, and the maximum and minimum temperatures to an output file. Close the files at the end of the program.

Reference no: EM13930215

Questions Cloud

Does the choice of the method make a difference : Use a 0.05 significance level to test the claim that success is independent of the method used. If someone wants to stop smoking, does the choice of the method make a difference?
Differences between different types of functional assessment : Read only the first five pages in the Herzinger & Campbell (2007) article: Comparing Functional Assessment Methodologies: A Quantitative Synthesis.
Major corporations with overseas subcontractors : Major corporations with overseas subcontractors (such as ikea in Bangladesh, uncle vet in India, and Nike in China) have been criticized often with substantial negative publicity when children as young as 10 have been found working in the subcontract..
What type ventilation system would you recommend : You have a production area where ten welders are producing small parts using MIG welding on mild steel for eight hours each day. There is a general "haze" visibly present, which increases throughout the work day. What type ventilation system would yo..
Average temperature for the month in new york city : As values are read in the loop calculate the necessary sums and values for the following (Do not determine any of the values merely by inspection): The average temperature for the month in New York City and the average temperature for the month in ..
Compare and contrast the different types of barriers : Compare and contrast the different types of barriers that might be used to protect openings in a floor at a production facility. What factors should an engineer take into account when designing one of these barriers? In your opinion
Disadvantages of adopting the ifrs conceptual framework : You are to submit a literature review on the topic of the advantages and disadvantages of adopting the IFRS conceptual framework.
Prepare any necessary journal entries : Prepare any necessary journal entries to adjust the books to the true cash balance.
The heat stress index (hsi) uses the terms o : The Heat Stress Index (HSI) uses the terms O (Oxygen required), M (Metabolism), R (Radiation) C (Convection), and E (Evaporation). Compare and contrast the terms. Provide an example of a control method that you believe would be effective in controlli..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create a base employee class

Create a base Employee class and a derived StudentEmployee class

  How do the properties derived classes differ

How do the properties derived classes differ

  Writing function that computes leap years

Write down function that computes leap years. Function prototype is as follows: Write function body which returns true if year is a leap year and false if year is not a leap year.

  Sequence of instructions that transfers data from memory

Write a sequence of instructions that transfers data from memory to an external I/O device by using channel 3 of the 8237 DMA controller. Transfer from 20000H-20FFFH.

  Application to accept the name of a folder

Therefore, she asks Hayley to modify the application to accept the name of a folder and display the following details of the files located in the folder: File name File size File creation date. Write the code that Hayley should write to create the..

  Calculate the commission owing for record

Construct an algorithm that will read a record on the file, calculate the commission owing for that record, and print the retail price, commission and employee number.

  Problems related to math power

Write a public static function named power that takes in two integers, a and b, and returns a^b, the first argument to the power of the second argument. You may NOT use Math.pow(), because that would be boring.

  Investigate the use of the random generator function

For this assignment you will have to investigate the use of the C++ random generator function, rand(). Rand() produces a random integer in the range of 0 to RAND_MAX (a constant -- often 32767 -- defined in the stdlib, automatically included in al..

  Reads in a list of integers

Write a program in C++ that reads in a list of integers into and array with base type int. Provide the facility to either read this array from the keyboard or from a file, at the user's option. If the user chooses file input, the program should reque..

  Implement the tronomino tiling algorithm

Implement the tronomino tiling algorithm,  our program should take an arbitrary input positive integer  k  in the Linux command line and generate a 2 k  * 2 k  board.

  What are c library functions gets and atoi

What are 'C' library functions gets and atoi and scanf used for and submit a flowchart or list of processing steps that can be used as a basis for the program.

  Write short c program to develops two processes

Write down a short C program which develops two processes. Each process must repeatedly write its own unique message to test file, one character at time. Do you see garbled messages in the file? Explain why or why not?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd