Question: Assignments What to Do create a function called totalNumbers that has two input parameters of type Integer. It finds the total number of integers between
Assignments
What to Do
create a function called totalNumbers that has two input parameters of type Integer. It finds the total number of integers between the two input parameters and returns it
Hints: find out which input parameteris larger
create a function called totalSum that has two input parameters of type Integer. It finds the sum of all the integers between the two input parameters and returns it
Hints:
find out which input parameter is larger
use a loop to calculate the sum of all the integers between the two input parameters
create main. In ma in prompt the user to give two numbers; use functions tot alNumbers and tot alSum to get the total and sum; divide sum by total to obtain average; finally display the average. For example, if the two numbers from the user are and then the display should be:
The average of all the integers between and is
Hints: assume the two numbers from the user is n and n and the calculated average is avg, then the display could be
pseudocode:
"The average of all the integers between n and n is avg
flowchart:
"The average of all the integers between &n& and &n& is &avg
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
