subject

Define an average function that takes 4 arguments, calculates the average of the 4 numbers passed to it, and returns the result back to the caller. Capture the 4 values from the user in main() and pass them to the function average. Call the average function from main. Print the results returned in the main function. Call the average function three more times with three more sets of four numbers and return the results back to the caller. Save the return values in variables in main(). Pass all four return values saved in main() back to the average function as arguments to calculate the average of the averages and return the result to main() which will print the final result ( average of the averages).

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 16:50, Laylahlettiere
Develop the program incrementally: a) start by reading and displaying each line of the input file to make sure you are reading the data set correctly. b) use the split string method to extract information from each line into a list. print the list to prove that this step is working correctly. d) convert the exam scores to type int and calculate the student’s average. display those items to prove this step is working correctly. e) create a tuple containing the six items for each student (name, exam scores, exam mean). display the tuples to prove this step is working correctly. (optionally, you may want to have the exam scores in a list so your tuple is (name, scores_list, f) append each tuple to a list. display the list to prove this step is working correctly. g) use the sort list method to re-order the tuples in the list. display the list to prove this step is working correctly. h) use a for statement to display the contents of the list as a table (with appropriate formatting). i) use a for statement to calculate the average of all scores on exam #1, then display the results. note that you could have calculated this average within the first loop, but we are explicitly requiring you to do this calculation by looping though your list of tuples. j) add the logic to calculate the average of all scores on exam #2, then display the results.
Answers: 2
image
Computers and Technology, 24.06.2019 18:20, 12375819
Use a while-end loop in a script file to calculate the sum of the first n terms of the series: summation sign on the top n bottom k=1 : )^k * k^2 +5k)/3^k show the script file and the two results of n = 10 and n = 20.
Answers: 2
image
Computers and Technology, 25.06.2019 02:00, lovemykay2355
Software and services are used to conceive, plan, and execute projects in any field. these tools are excellent methods of increasing the probability of successful projects. open source linux project management mind-mapping
Answers: 2
image
Computers and Technology, 25.06.2019 08:00, brandiewilliams12567
Astrategy for speeding up hard drive performance is
Answers: 2
You know the right answer?
Define an average function that takes 4 arguments, calculates the average of the 4 numbers passed to...

Questions in other subjects: