Purchase Solution

C++ random number, max, min, average, difference

Not what you're looking for?

Ask Custom Question

Write a program that:
a. Randomly generates the daily temperature (in F) of two cities A and B the month of July. The temperatures are integers in the range [60.. 90] and they are stored in two arrays tA and tB.
b. Calculate the average temperature for the month in each city.
c. How many days was the temperature above the average in each city.
d. How many days, and on which days in the month was the temperature in city A lower than the temperature in city B?
e. How many days, and on which days in the month was the temperature the same in both cities?
f. On which day(s) the difference |tA[i] - tB[i]| was maximum?
Important notes:
 The program should consist of a main function and at least six other functions that solve the above sub-problems.
 All function should be called by main function.
 All results should be printed only by the main function.
 No global variables and global arrays should be declared in the program.]

Program has to be done at the easiest lvl of comprehension possible and the program has to have notes to make it more readable.

Purchase this Solution

Solution Summary

Randomnly generates the daily temperature (in F) of two cities A and B the month of July. The temperatures are integers in the range [60.. 90] and they are stored in two arrays tA and tB. Then calculate average, maximum, minimum, maximum difference, lower, same temperatures

Purchase this Solution


Free BrainMass Quizzes
Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Basic Networking Questions

This quiz consists of some basic networking questions.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.