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 2 and 6, then the display should be:
The average of all the integers between 2 and 6 is 4
Hints: assume the two numbers from the user is n 1 and n 2, and the calculated average is avg, then the display could be
pseudocode:
"The average of all the integers between ", n1," and ", n2," is ", avg
flowchart:
"The average of all the integers between " &n1& " and " &n2& " is " &avg
Assignments What to Do create a function called

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!