Write function to compute average temperature for the month

Assignment Help Programming Languages
Reference no: EM1370548

As part of a global warming analysis, a research facility tracks outdoor temperatures at the North Pole once a day, at noon, for a year. At the end of each month, these temperatures are entered into the computer and processed. The operator will enter 28, 29, 30, or 31 data items, depending on the month. You may use -500 as a sentinel value after the last temperature, since that is lower than absolute 0. Your main program should call the read_temps(), hot_days(), and print_temps() functions described here:

1. Write a function, read_temps(), that has one parameter, an array called temps, in which to store the temperatures. Read the real data values for one month and store them into the slots of an array. Return the actual number of temperatures read as the result of the function.

2. Write a function, hot_days(), that has two parameters: the number of temperatures for the current month and an array in which the temperatures are stored. Search through the temperature array and count all the days on which the noon temperature exceeds 32 F. Return this count.

3. Write a function, print_temps(), with ths same two parameters plus the count of hot days. Print a neat table of temperatures. At the same time, calculate the average temperature for the month and print it at the end of the table, followed by the number of hot days.

Reference no: EM1370548

Questions Cloud

Strategy to monopolistic competitive model : Professor Michael Porters generic strategy options for competing are the differentiation approach and cost leadership approach. The first involves competing by having the better product and second by having lower cost that ones competitors. Relate..
Determine the environmental variable : Conduct an environmental scan of businesses at present climate to determine which variable of the environment, such as economic, political, social
Different strategies that improve person-job matching : Person-Job Matching - Employees in the company's warehouse are making numerous errors in inventory control and breaking items shipped.
Computing herfindahl-hirshman index : Compute the pre-merger HHI measures for each market. How would a merger affect the market's HHI?
Write function to compute average temperature for the month : Write the function, print_temps(), with same two parameters plus count of hot days. Print neat table of temperatures. At same time, compute average temperature for the month.
Ways of advising newly industrialized countries : The World Bank is at present advising newly industrialized countries on how to encourage growth and they have asked for your help.
Price discrimination-economic profits : Many airline routes worldwide are served by only one airline (a monopoly). Within the U.S., these are often from a small or mid-sized city to a major carrier hub and frequently operated by a regional carrier under contract to the larger airline.
Show the corporate scandals and power shifts : Explain the shift in corporate power from the CEO to other stakeholders and impact on corporate governance
Difference between monopoly and oligopoly : Describe the difference between a monopoly and an oligopoly, and a cartel and provide an example of the monopoly, an oligopoly, and a cartel and write down the welfare effects of monopolies and oligopolies.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write program to accept name and score of all batsmen

Write a program to accept name and score of all batsmen of a team and print them in the given manner: INPUT:names[]={nam1,nam2,nam3,nam4,nam5,nam6} & scores[]={48,65,73,10,90,84}

  Create application to enter five-digit credit card number

Create an application that allows the user to enter a five-digit credit card number; assume that the fifth digit is the check digit.

  Create an xml document that marks up nutrition facts

Create an XML document that marks up the nutrition facts for a package of Grandma White's cookies. A package of cookies has a serving size of 1 package.

  Store normal for each face in array using technique

Use technique of the Astle text to store normal for each face in faceData array enable lighting and add point light source if the light is positioned at the origin

  Write program to choose female student-completed more course

Suppose that input consists of a student file. You are told to write a program to select female students who have completed more than two courses.

  Design implement application displays button-label on screen

Design an implement an application that displays a button and a label on a screen. Every time the button is pushed, the label will display a random number.

  Function to count number of times the given number occured

Write a main function to input 20 integers in the range of 1 to 6. Write a function to count the number of times the numbers 2 and 5 occur. The function should declare static variables count2 and count5.

  Program to overload addition operator

The class should also provide the following overloaded operator capabilities: Overload the addition operator (+) to add two Polynomials.

  Explaining valid advice for naming variables

Which of the following is valid advice for naming variables? To save typing, make most variable names one or two letters.

  Create program which asks for number of fat grams

Create a program which asks for number of fat grams and calories in a food item. Validate input as follows: Make sure number of fat grams and calories are not less than 0.

  Write a program that bounces blue ball inside jpanel

Write a program that bounces a blue ball inside JPanel. The ball should begin moving with a mousePressed event. When the ball hits the edge of the JPanel.

  Compute and print annual salary of employee

Identify input, process and output to solves each problem. Compute and print the annual salary of employee. suppose the employee receive 6% increase in pay.

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