A restaurant in Amman provides 2 offers for customers: o Regular Meal: The base price of the meal is 2.00 JD. The meal comes with one regular sandwich and one drink. Customers can order extra drinks each for 0.5 JD. Also, customers can order extra sandwiches each for an extra 1.25 JD o Family Meal: The base price of the meal is 5.00 JD. The meal comes with 3 regular sandwiches and 3 drinks. Customers can order extra drinks each for 0.35JD. Also customers can order extra sandwiches each for extra 0.75 JD Write a function named displayMenu that displays the following options for the user to select from o RRegular Meal o F-Family Meal o Q-Exit the program Write a function named getOption that calls the displayMenu function and prompts the user to enter one of the 3 letters. When an invalid option code is detected, the function will display an error message, and then the menu displayed again until a valid option is used. Write a function named getlnputs to read a. the number of extra sandwiches b. the number of extra drinks. Write a function named billCalculator that takes as arguments the meal's type, number of extra sandwiches, and the number of extra drinks. The function billCalculator returns the amount of money that the customer will be billed The program (i.e. the main function) Should properly o Call getOption to get the user choice o Call getInputs to read the number of extra sandwiches, and the number of extra drinks o Call billCalculator and prints the amount of money that the customer will be billed o The program should repeat the above steps until the user enters the Q option to exit

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...
icon
Related questions
Question

note : dont use string library 

it is a C code

A restaurant in Amman provides 2 offers for customers:
o Regular Meal: The base price of the meal is 2.00 JD. The meal comes with one regular sandwich and one drink. Customers can order extra
drinks each for 0.5 JD. Also, customers can order extra sandwiches each for an extra 1.25 JD
o Family Meal: The base price of the meal is 5.00 JD. The meal comes with 3 regular sandwiches and 3 drinks. Customers can order extra
drinks each for 0.35JD. Also customers can order extra sandwiches each for extra 0.75 JD
Write a function named displayMenu that displays the following options for the user to select from
o RRegular Meal
o F- Family Meal
o Q- Exit the program
Write a function named getOption that calls the displayMenu function and prompts the user to enter one of the 3 letters. When an invalid
option code is detected, the function will display an error message, and then the menu displayed again until a valid option is used.
Write a function named getlnputs to read
a.
the number of extra sandwiches
b.
the number of extra drinks.
Write a function named billCalculator that takes as arguments the meal's type, number of extra sandwiches, and the number of extra
drinks. The function billCalculator returns the amount of money that the customer will be billed
The program (i.e. the main function) Should properly
o Call getOption to get the user choice
o Call getlnputs to read the number of extra sandwiches, and the number of extra drinks
o Call billCalculator and prints the amount of money that the customer will be billed
o The program should repeat the above steps until the user enters the Q option to exit
Transcribed Image Text:A restaurant in Amman provides 2 offers for customers: o Regular Meal: The base price of the meal is 2.00 JD. The meal comes with one regular sandwich and one drink. Customers can order extra drinks each for 0.5 JD. Also, customers can order extra sandwiches each for an extra 1.25 JD o Family Meal: The base price of the meal is 5.00 JD. The meal comes with 3 regular sandwiches and 3 drinks. Customers can order extra drinks each for 0.35JD. Also customers can order extra sandwiches each for extra 0.75 JD Write a function named displayMenu that displays the following options for the user to select from o RRegular Meal o F- Family Meal o Q- Exit the program Write a function named getOption that calls the displayMenu function and prompts the user to enter one of the 3 letters. When an invalid option code is detected, the function will display an error message, and then the menu displayed again until a valid option is used. Write a function named getlnputs to read a. the number of extra sandwiches b. the number of extra drinks. Write a function named billCalculator that takes as arguments the meal's type, number of extra sandwiches, and the number of extra drinks. The function billCalculator returns the amount of money that the customer will be billed The program (i.e. the main function) Should properly o Call getOption to get the user choice o Call getlnputs to read the number of extra sandwiches, and the number of extra drinks o Call billCalculator and prints the amount of money that the customer will be billed o The program should repeat the above steps until the user enters the Q option to exit
o The program should repeat the above steps until the user enters the Q option to exit
Add your name, your University ID number and section number as a comment at the beginning of this program.
Sample Run
Welcome to Structured Resturant
Select one of the following options:
R- Regular Meal
F- Family Meal
Q- Exit the program
R
How many extra sandwiches?2
How many extra drinks?2
The bill amount is
5.500000
Select one of the following options:
R- Regular Meal
F- Family Meal
Q- Exit the program
Invalid Option
Select one of the following optians:
R- Regular Meal
F- Family Meal
Q- Exit the program
Transcribed Image Text:o The program should repeat the above steps until the user enters the Q option to exit Add your name, your University ID number and section number as a comment at the beginning of this program. Sample Run Welcome to Structured Resturant Select one of the following options: R- Regular Meal F- Family Meal Q- Exit the program R How many extra sandwiches?2 How many extra drinks?2 The bill amount is 5.500000 Select one of the following options: R- Regular Meal F- Family Meal Q- Exit the program Invalid Option Select one of the following optians: R- Regular Meal F- Family Meal Q- Exit the program
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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…
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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY