View the step-by-step solution to:

how would i add a loop to this psuedocode so the menu repeats itself until the user is done?

how would i add a loop to this psuedocode so the menu repeats itself until the user is done?


// Declare a variable to hold the menu selection.

Declare Integer menuSelection

DO

//Display the menu and get the users selection.

Call displayMenu(menuSelection)

// Perform the selected operation

Select menuSelection

Case 1:

 call enterHeartrate()

case 2:

call enterWeight()

case 3:

Call enternumMinofactivity()

End Select

While menuSelection > 0 and menuSelcetion < 4


Module displayMenu(intefer Ref selection)

//Display the menu

Display "Main Menu

Display"1.What is your heart rate?"

Display "2.Enter your weight in pounds(lbs)."

Display "3. How many minutes did you walk today?"

Display "4. End the program."

//get the users menu selection

Display "Enter your selection. "

Input selection

//Validate the menu selection

While selection < 1 OR selection > 4

Display "That is an invalid selection."

Display "Enter 1,2,3 or 4."

Input selection

End While

End module

Top Answer

Output:... View the full answer

CmenueSelectionoutput.PNG

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online