The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 3 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Ac€?c Translate the pseudocode main algorithm to the main method.
GIVENS: (none)
RESULTS: (none)
INTERMEDIATE:
n1, n2 ,n3 n1, n2 ,n3 (three real numbers) (three real numbers)
average (the average of n2, n2, n3)
HEADER: main()
BODY:
(get the numbers from the user)
PrintLine(Ac€A?Please enter three numbersAc€??)
n1 Ac† ReadReal()
n2 Ac† ReadReal()
n3 Ac† ReadReal()
(Call the problem solving algorithm)
average Ac† computeAverage(n1 n2 n3)
14
computeAverage(n1, n2, n3)
(Print the results)
PrintLine(Ac€A?The average is Ac€A?, average);
Ac€?c Translate the pseudocode algorithm to a problem solving for
averaging three numbers.
GIVENS: Num1, Num2 ,Num3 (three numbers)
RESULTS: Avg (the average of Num1, Num2, and Num3)
INTERMEDIATE:
Sum (the sum of Num1, Num2, Num3)
HEADER: (Avg) Ac† computeAverage(Num1, Num2 ,Num3)
BODY:
Sum Ac† Num2 + Num2 + Num3
Avg Ac† Sum / 3
Ac€?c Write the complete Java program
Ac€?c Use the two methods model
Ac€?c Main method:
Ac€?c Main inputs 3 numbers from the user
Ac€?c Sends them to the problem solving method
Ac€?c Get the average back
Ac€?c Problem solving method:
Ac€?c Receive 3 numbers
Ac€?c Compute average
Ac€?c Return average
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll