Directions: You will write a menu driven program in C that simulates an online coffee shop application. Many food industries allow you to order online through your smart phone. In these applications, you can order food, view your account balance, reload account balance, and much more. In this large programming assignment, you write a simple console coffee shop application.
The program will have the following setup.
In order to create this program, you will use the following function prototypes.
void Greeting(void); //welcome the user to the coffee shop
void Order (double *balance); //user will make a purchase
void ViewAccount(double *balance); //display current account balance of user
void Transaction(double *balance, double price); //transaction with user account
void Reload(double *balance); //reload your account balance with three options
void DisplayMenu(void); //display beverage/food options and prices
void SaveBalance (double *balance); // Before terminating program, balance is saved in a text file
You cannot add any additional functions or remove them. Modifying them in any way (name, parameters, etc...) will result in point deductions! Utilize them the way they are provided!
The function prototypes are provided for you here. You will create a file called Large Program2_lastnamefirstname.c for this assignment and write out the code. Do NOT modify any of the function prototypes that are provided for you! Any modifications from the provided function prototypes will result in points being deducted! You are allowed to use the same message that is provided in the sample output for your program. You can also make modifications to the text of messages as long as the program follows all directions as stated in this assignment.
Here is the order of steps I would strongly consider when attempting the large program assignment. After each of these steps, see if your program builds/compiles successfully and performs the correct task. See if the output is what you were expecting.
1. Start with the Message Greeting. Try to get the program to welcome the user.
2. After a successful message greeting, try to design menu driven component. Hint: Think of how to use a while loop and switch statement.
3. After getting the menu working. Work on the display menu function to display all food/beverage prices. Note. This is different from menu that shows user options of what they can do.
4. After getting the display menu function working, work on the view account summary function.
5. After getting the view account summary, work on the reload function to increase your account balance.
6. After getting the reload function to work, begin the ordering function. This is where the user will pick an item to purchase and make a transaction.
7. Test your program with different inputs to see if it works successfully.
8. OPTIONAL BONUS: Before program terminates, save balance into a text file.
Here are some tips and tricks that will help you with this assignment and make the experience enjoyable.
Here is a sample output of the fully working program.
Welcome to the Palm Beach State College Coffee Shop!
We serve delicious coffee and snacks!
How can we help you today?
Please select one of the following options.
O: Order
V: View Account Summary
D: Display Menu
R: Reload Account
E: Exit
************************************************************
Please select what you like to do.
Option Selected: v
************************************************************
You selected View Account Summary Option.
Here is your current account balance.
You have $0.00 in your account.
************************************************************
Please select one of the following options.
O: Order
V: View Account Summary
D: Display Menu
R: Reload Account
E: Exit
************************************************************
Please select what you like to do.
Option Selected: D
************************************************************
You have selected Display Menu Option.
Here are the options!
************************************************************
1. Hot Coffee $3.53
2. Iced Coffee $4.20
3. Hot Latte $3.13
4. Iced Latte $4.12
5. Bagel (includes cream cheese) $3.99
6. Big Scone $4.99
7. Frozen Coffee $5.03
8. Bottle Water $1.50
************************************************************
Please select one of the following options.
O: Order
V: View Account Summary
D: Display Menu
R: Reload Account
E: Exit
************************************************************
Please select what you like to do.
Option Selected: o
************************************************************
You have selected the Order Option.
Here are the options.
Here are the options!
************************************************************
1. Hot Coffee $3.53
2. Iced Coffee $4.20
3. Hot Latte $3.13
4. Iced Latte $4.12
5. Bagel (includes cream cheese) $3.99
6. Big Scone $4.99
7. Frozen Coffee $5.03
8. Bottle Water $1.50
What would you like today?Option Selected: 2
Iced Coffee has been selected. Total cost is $4.20
Beginning Transaction Process.
You do not have enough in your account.
Please reload your account.
How much would you like to reload to your account?
1: $1.00
2: $5.00
3: $10.00
Option Selected: 2
$5.00 has been added to your account successfully!
Billing $4.20 to your account.
Transaction was successful!
You now have $0.80 in your account balance.
************************************************************
Please select one of the following options.
O: Order
V: View Account Summary
D: Display Menu
R: Reload Account
E: Exit
************************************************************
Please select what you like to do.
Option Selected: R
************************************************************
You have selected Reload Account option.
How much would you like to reload to your account?
1: $1.00
2: $5.00
3: $10.00
Option Selected: 3
$10.00 has been added to your account successfully!
************************************************************
Please select one of the following options.
O: Order
V: View Account Summary
D: Display Menu
R: Reload Account
E: Exit
************************************************************
Please select what you like to do.
Option Selected: V
************************************************************
You selected View Account Summary Option.
Here is your current account balance.
You have $10.80 in your account.
************************************************************
Please select one of the following options.
O: Order
V: View Account Summary
D: Display Menu
R: Reload Account
E: Exit
************************************************************
Please select what you like to do.
Option Selected: O
************************************************************
You have selected the Order Option.
Here are the options.
Here are the options!
************************************************************
1. Hot Coffee $3.53
2. Iced Coffee $4.20
3. Hot Latte $3.13
4. Iced Latte $4.12
5. Bagel (includes cream cheese) $3.99
6. Big Scone $4.99
7. Frozen Coffee $5.03
8. Bottle Water $1.50
What would you like today?Option Selected: 5
Bagel (includes cream cheese) has been selected. Total cost is $3.99
Beginning Transaction Process.
Billing $3.99 to your account.
Transaction was successful!
You now have $6.81 in your account balance.
************************************************************
Please select one of the following options.
O: Order
V: View Account Summary
D: Display Menu
R: Reload Account
E: Exit
************************************************************
Please select what you like to do.
Option Selected: E
************************************************************
Thank you for visiting our coffee shop!
You have $6.81 in your account.
Have a great day!