1. Write a program that displays the following menu. The symbols show where newline characters ("\n") should be displayed: Health Club Membership Menu له 1. Standard Adult Membership 2. Child Membership 3. Senior Membership 4. Quit the programe H Enter your choice: Check if your code works correctly before implementing the next parts. If the user enters 1, 2, or 3, the program should print the following string as a prompt: "For how many months? " The program should then read the months value, calculate the total charge which is months* membership rate, and display it. Below is the monthly membership rate for different cases: Adult membership: $40.00 Child membership: $20.00 Senior membership: $30.00 Check if your code works correctly before implementing the next parts. Your program keeps showing the menu and displaying the charges unless the user enters 4 (Quit case). Select the best type of loop for displaying a menu repeatedly. Check if your code works correctly before implementing the next parts. Input Validation: Select the best type of loop for input validations. The only valid menu choices the user can make are 1, 2, 3, or 4. If the user makes a menu choice other than one of these numbers, the program should print the following strings and receives the choice value again: "Menu choice can only be 1 to 4." "Please enter a valid menu choice: " If the user enters a negative number for months, the code should print the following string, and receive the value again: "months value cannot be negative." "For how many months? "
1. Write a program that displays the following menu. The symbols show where newline characters ("\n") should be displayed: Health Club Membership Menu له 1. Standard Adult Membership 2. Child Membership 3. Senior Membership 4. Quit the programe H Enter your choice: Check if your code works correctly before implementing the next parts. If the user enters 1, 2, or 3, the program should print the following string as a prompt: "For how many months? " The program should then read the months value, calculate the total charge which is months* membership rate, and display it. Below is the monthly membership rate for different cases: Adult membership: $40.00 Child membership: $20.00 Senior membership: $30.00 Check if your code works correctly before implementing the next parts. Your program keeps showing the menu and displaying the charges unless the user enters 4 (Quit case). Select the best type of loop for displaying a menu repeatedly. Check if your code works correctly before implementing the next parts. Input Validation: Select the best type of loop for input validations. The only valid menu choices the user can make are 1, 2, 3, or 4. If the user makes a menu choice other than one of these numbers, the program should print the following strings and receives the choice value again: "Menu choice can only be 1 to 4." "Please enter a valid menu choice: " If the user enters a negative number for months, the code should print the following string, and receive the value again: "months value cannot be negative." "For how many months? "
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
Please provide a Matlab live-script code answering this question. Add extra features to the code according to your preference that works. Thank you!
![1. Write a program that displays the following menu. The symbols show where newline
characters ("\n") should be displayed:
Health Club Membership Menu
H
1. Standard Adult Membership
2. Child Membership
3. Senior Membership
4. Quit the programe
d
Enter your choice:
Check if your code works correctly before implementing the next parts.
If the user enters 1, 2, or 3, the program should print the following string as a prompt:
"For how many months? "
The program should then read the months value, calculate the total charge which is
months* membership rate, and display it. Below is the monthly membership rate for
different cases:
Adult membership: $40.00
Child membership: $20.00
Senior membership: $30.00
Check if your code works correctly before implementing the next parts.
Your program keeps showing the menu and displaying the charges unless the user
enters 4 (Quit case). Select the best type of loop for displaying a menu repeatedly.
Check if your code works correctly before implementing the next parts.
Input Validation:
Select the best type of loop for input validations.
The only valid menu choices the user can make are 1, 2, 3, or 4. If the user makes a
menu choice other than one of these numbers, the program should print the following
strings and receives the choice value again:
"Menu choice can only be 1 to 4."
"Please enter a valid menu choice: "
If the user enters a negative number for months, the code should print the following
string, and receive the value again:
"months value cannot be negative."
"For how many months?
"1](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fabd5e741-0235-409f-80de-883f5f0e5da7%2F6fcf3009-ab68-4457-b55a-c0ac7a1148c8%2Ftkc2ca_processed.jpeg&w=3840&q=75)
Transcribed Image Text:1. Write a program that displays the following menu. The symbols show where newline
characters ("\n") should be displayed:
Health Club Membership Menu
H
1. Standard Adult Membership
2. Child Membership
3. Senior Membership
4. Quit the programe
d
Enter your choice:
Check if your code works correctly before implementing the next parts.
If the user enters 1, 2, or 3, the program should print the following string as a prompt:
"For how many months? "
The program should then read the months value, calculate the total charge which is
months* membership rate, and display it. Below is the monthly membership rate for
different cases:
Adult membership: $40.00
Child membership: $20.00
Senior membership: $30.00
Check if your code works correctly before implementing the next parts.
Your program keeps showing the menu and displaying the charges unless the user
enters 4 (Quit case). Select the best type of loop for displaying a menu repeatedly.
Check if your code works correctly before implementing the next parts.
Input Validation:
Select the best type of loop for input validations.
The only valid menu choices the user can make are 1, 2, 3, or 4. If the user makes a
menu choice other than one of these numbers, the program should print the following
strings and receives the choice value again:
"Menu choice can only be 1 to 4."
"Please enter a valid menu choice: "
If the user enters a negative number for months, the code should print the following
string, and receive the value again:
"months value cannot be negative."
"For how many months?
"1
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY