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

  Write a simplified version of sort called my-sort-1

Write a simplified version of sort called my-sort-1 that reads from standard input, sorts lexicographically, and writes the output to standard output.

  Identify and explore challenges and opportunities

LO2 Identify and explore contemporary challenges and opportunities in information systems and to formulate an opinion or judgement and offer possible solutions.

  Alice and bob are experimenting with csma using walsh table.

Alice and Bob are experimenting with CSMA using walsh table. Alice uses the code[+1,+1] and Bob uses the code[+1,-1]. Assume that they simultaneously send a hexadecimal digit to each other.

  We will compare the performance of a vector processor

In this problem, we will compare the performance of a vector processor with a hybrid system that contains a scalar processor and a GPU-based coprocessor.

  Write algorithm computing total flight time and distance

Write an algorithm for computing total flight time and the horizontal distance traveled by the cannon ball for the problem discussed in class?

  String s of lowercase english letters

Given a string S of lowercase English letters, write a program to find the longest magic string than can be obtained by removing some letters of S. If there are more than one solutions, choose the longest magic string which is lexicographically small..

  Is the java source filename extension

is the Java source filename extension? What is the Java bytecode filename extension?

  The caption element provides caption for image true or false

The caption element provides a caption for the image in a figure element. True or False

  Create a pogram that uses inheritance

The values you generate should be floating points and allow for decimal points. to perform this task you should generate random numbers between 200 and 1000 and then divide by 100 to generate the decimal points.

  Write a problem that prompts the user for a radius

Write a problem that prompts the user for a radius and then prints: •The area and the circumference of a circle with that radius •The volume and surface area of a sphere with that radius

  Community supported agriculture

Your Community Supported Agriculture (CSA) farm delivers a box of fresh fruits and vegetables to your house once a week. For this programming project, define the class BoxOfProduce that c o n t a i n s exactly three bundles of fruits or vegetab..

  Message exchange patterns in soap

Let two main types of message exchange patterns in SOAP (and operation types in WSDL): (1) request-response and (2) one-way.

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