Update the variables belonging to the main program

Assignment Help Basic Computer Science
Reference no: EM13666527

Write a program using functions where a function collects 8 numbers from the user, finds the largest, smallest of those 8 numbers and uses passing by reference to update the variables belonging to the main program.

Then the main program calls a function called CollectNumbers() and passes the variables largest, smallest BYREF(by reference). The CollectNumbers() return the average back to the main.

Here is what the functions should accomplish.

'main program.
Creates variables largest, smallest, average.
Calls CollectNumbers() function and sends variables largest, smallest BYREF(by reference)
The CollectNumbers() function should return the average.
The main displays the average returned by the function and , smallest and largest variables updated by the function.

Function CollectNumbers() receives largest and smallest by reference.
The purpose of this function is to take 8 numbers from the user.
Find the largest, smallest and the average of those numbers.
The function puts the largest of the 8 numbers in received parameter largest and the smallest of those 8 numbers in the received parameter smallest.
Then, Send the average back to the main.

Reference no: EM13666527

Questions Cloud

Find what is the balls acceleration at its highest point : A tennis player hits a ball at ground level, giving it an initial velocity of 26.0 m/s at 54.0 degree above the horizontal. Find what is the ball's acceleration at its highest point
Find how far horizontally does the rock travel : A balloon carrying a basket is descending at a constant velocity of 20.0 m/s. Find how far horizontally does the rock travel before it hits the ground
Compare and contrast distance-vector and link state routing : Compare and contrast distance-vector and link state routing
Compute the reaction force to the force : Assume you seated on a wheeled desk chair at your desk. Consider friction forces between the floor and the chair to be negligible. Compute the reaction force to the force that caused your acceleration
Update the variables belonging to the main program : Write a program using functions where a function collects 8 numbers from the user, finds the largest, smallest of those 8 numbers and uses passing by reference to update the variables belonging to the main program.
Obtain the final temperature of the watermelon and soda : A cooler contains 12 cans of soda at 5oC. Each soda has mass 0.35 kilogram and a specific heat capacity of 3800J/kgC. find the final temperature of the watermelon and soda
Compute the force acting on the sled : A sled with mass 8.00 kilogram moves in a straight line on a frictionless horizontal surface. Use the work-energy theorem to compute the force acting on the sled
Determine how far the book moves from its initial position : A 2.50 kg textbook is forced against a horizontal spring of negligible mass and force constant 250 N/m, determine how far the book moves from its initial position before coming to a rest
Designing a star schema : Designing a Star Schema

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Non-finitely-describable languages closed underconcatenation

Are the non-finitely-describable languages closed under concatenation? Kleene closure? Complementation? Union?

  Invoke method to tell the air conditioner object to turn on

Using the reference variable, invoke a method to tell the air conditioner object to turn on.

  Make a class for a singly linked circular list

Make a class for a singly linked circular list that has no end and no beggining. The only access on the list is a single reference, current, that can point to any link on the list.

  Write a program with the output hello world hello

Write a program with the following output: (Notice the newline and space) Hello world! Hello

  The information technology division

The information technology division

  Describe what each of the two-dimensional characters

Describe what each of the two-dimensional characters might represent and the data that would be held in the array. Also, provide an example array declaration.

  Discuss currently used tools and recommended measures to def

Web phishing, pharming and vishing are popular web based scams. Discuss currently used tools and recommended measures to defeat this kind of attacks efficiently? Specifically focus on solutions that can be implemented at the network infrastruc..

  Describe constraints which encode that cell is observed

Describe constraints which encode that cell (1, 2) is observed and indicates mine is not present, that cell (2, 1) is observed and indicates a mine is present, and that remaining cells are unobserved.

  Our model assumes that the arrival distribution of customers

In the McBurgers simulation, our model assumes that the arrival distribution of customers is the same throughout the entire day. Do you think this is a realistic assumption? If not, explain how you could modify the model to make it a better repres..

  What are the advantages of flash memory over hard disk

1. what are the advantages of flash memory over hard disk storage? what are the advantages of hard disk over flash

  Sockets are considered a low-level

Sockets are considered a low-level means for two applications to connect to each other and send/receive information. An alternative approach is the notion of distributed objects.

  Style is require but comments are not

Style is require but comments are NOT required.  ? Include appropriate import statements for your file.

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