Find average will return average of the number of the array

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

Computer science assignment

Write a complete C++ program that will randomly generate 20 integers between the ranges 60 - 100 and store the result in an array. The program should consists of the following functions to test out the array:

a. FindMax will return the largest number of the array.

b. FindMin will return the smallest number of the array.

c. FindAverage will return the average of the number of the array.

d. FindMinGap will return the smallest gap in between the adjacent entries of the array. (A gap between two numbers is the absolute value of their difference)

e. FindGapSum will return the sum of gaps between adjacent entries of an array.

The main program should be similar to below:

int main() {

int array[20] = { };

// initialize all the value of the array;

cout << findMax(array, 20) << endl;

cout << findMin(array, 20) << endl;

cout << findAverage(array, 20) << endl;

cout << findMinGap(array, 20) << endl;

cout << findGapSum(array, 20) << endl;

}

Reference no: EM131066815

Questions Cloud

What is the effective interest rate per payment : You have made an investment that pays you $2,000 at the end of the first year, and then decreases by 9% each year for 4 more years (5years total). What is the FUTURE worth of this investment? (interest rate= 9%).
How high are you off the ground after 5 minutes : How high are you off the ground after 5 minutes?
Mass of sodium phosphate : What mass of sodium phosphate would have to be added to 1.5Lof this solution to completely eliminate the hard water ions? Assume complete reaction.
Determining an empirical formula by combustion analysis : The compound dioxane, which is used as a solvent in various industrial processes, is composed of C, H, and O atoms. Combustion of a 2.203-g sample of this compound produces 4.401 g CO2 and 1.802 g H2O. A separate experiment shows that it has a mol..
Find average will return average of the number of the array : FindAverage will return the average of the number of the array. FindMinGap will return the smallest gap in between the adjacent entries of the array. (A gap between two numbers is the absolute value of their difference).
How many different four- letter secret codes can be formed : You are taking a multiple-choice test that has 9 question. Each of the question has 3 choice with one correct choice per question. If you select one of the option per question and leave nothing blank. In how may ways can you answer the question?
What is the probability of randomly generating your cousin''s : What is the probability of randomly generating your cousin's telephone number?
Information you learned and evaluated in developing : At least two insights you have gained with regard to the impact of parents, families, early childhood care and education, and community on children's development
Find the probability of getting a five each time : You are dealt one card from a 52- card deck. Then the card is replaced in the deck, the deck is shuffled, and you draw again. Find the probability of getting a picture card the first time ad a spade the second time.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Question rearding the software process models

Waterfall, V-shape, and Rapid Application Development (RAD) are among well-established software process models that have been used to develop software

  Create class having constructor to recieve two ints

Create a class (in C++)named Card. The class should have two int data members named face and suit.The class should have a constructor that recieves the two ints and uses them to initialize the data members.

  Approximately normally distributed

Write a program MakeFile.cpp that creates a file random.dat that contains 200 random numbers where each number is the sum of 12 random values rand( )%9. When we add a sufficient number of uniformly distributed numbers the result is approximately n..

  Calculate the celsius equivalent of a fahrenheit temperature

Prepare a program to calculate the Celsius equivalent of a Fahrenheit temperature

  Define and implement a default constructor for robot class

Define and implement a default constructor for the Robot class that sets the locations to zero, and load to false (no load is being carried by the Robot)

  What are the values of queuefront and queuerear

What are the value of queueFront and queueRear after removing an element from the queue? Also what was the position of the removal queue element?

  Design an algorithm to assign costs to seats.

Implement a simple seat reservation system for a theater in C++. The seats in the theater will be represented with a two dimensional array. The closer the seats are to the stage, the more expensive the seats are. Moreover, within a row, the seats ..

  Demonstrate the construction and output of an array

In fluid mechanics, the Reynolds number (Re) is a dimensionless quantity that is used to help predict similar flow patterns in different fluid flow situations. For example, Reynolds numbers can be computed for different velocities of fluid flow over ..

  Write a main function that reads pairs of positive integers

Prepare a function that has two positive integer parameters (say high and low) that returns the number of powers of two between (but not equal to) those parameters.

  Program to compute with two numbers.

I have the 1st two statements figured out, and had the arithmetic figured out based on results of 22 and 16, but turns out I interpreted it wrong and results should be what's posted above when the user changes the two numbers. The tutorial says no..

  Explain how priority queue list works

Hi. I have done a priority queue list. We have been giving test code to test our list. I will post what I have along with the issues. I keep getting an error with the getelement() part in the main program where we are supposed to print out the ele..

  Implement a class called hugeinteger

Using your own Linked List implementation (see attached), implement a class called HugeInteger that represents arbitrary sized integers and supports addition only. You may only use the tools that have introduced in class, and you MAY NOT use Java'..

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