Question: This assignment needs to be completed using Flowgorithim What to Do 1 . create a function called totalNumbers that has two input parameters of type

This assignment needs to be completed using Flowgorithim
What to Do
1. 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 parameter is larger
2. 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
3. create main. In main, prompt the user to give two numbers; use functions totalNumbers and totalSum
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 n1 and n2, 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

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!