Solved: Write a program that can read a list of numbers, f…

$30.00

Category:

Description

Solved: Write a program that can read a list of numbers, f…

Write a program that can read a list of numbers, find their average, sort the numbers, and search the average. The detailed tasks are described below. 1) Write a function named EvenOrOdd, which inspects the argument and returns an integer value. If the argument is even, the function returns 0; if odd, returns 1. 2) Write a function named ArrayAverage, which returns the average of an array. 3) Read 6 integers from the user’s input and store them in an array named numbers. Display the array elements (in the original order). 4) Declare an integer variable named avg. Call the function ArrayAverage to compute the average of the elements in the array numbers, and assign it to avg. 5) If avg is even, do the bubble sorting; if odd, do the selection sorting. In both cases, sort the array to an ascending order. Display the sorted array elements on the screen. 6) Apply the binary searching to find whether avg is in the array numbers. Display the searching result on the screen.

 


error: Content is protected !!