In this lab work, you will implement a coffee shop example. In this coffee shop, everything must progress as if it does in real life. It means that the program should ask a person for body temperature in Celsius, and grant or reject access to a coffee shop. When a customer orders a coffee, they have to choose a size such as Small, Medium, and Large then, depending on the order, the price has to change. The price also has to change depending on the type of coffee. For example, for coffees that are similar to espresso, you also need to take every shot of espresso into account. The actual prices of the coffees depend on your imagination however, they should be realistic. Some hints: • Focus on dividing your program into multiple functions. • You can also return double or integer types of values from your functions, so use them if you can. • Don't just code a function every possible type of, and try to make it generic as much as possible. Be creative. Fill the gaps using your imagination. This is an open ended lab work. Expectations: 1. You will have milk, steamed milk, milk foam, and hot chocolate that can be ordered for a specific type of coffee. 2. You will have two basic types of coffee, filter coffee, and espresso(Hint: Don't forget about shots, that could be a measure for the price). 3. We are expecting your program to be able to order; Cappuccino, Latte, Mocha, Flat White, or Filter Coffee. All of these are base types of orders, however, you can always have extra milk or hot chocolate, so make sure you take that into account. 4. Customers are not allowed to enter if their body temperature is higher than 36.5 Celsius. 5. The user will enter integer values to select their options for everything in the program. 6. Add an exit option for the user so he/she can cancel the order. 7. The program should terminate if the customers try to order his/her 4th coffee.

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
In this lab work, you will implement a coffee shop example. In this coffee shop, everything must
progress as if it does in real life. It means that the program should ask a person for body
temperature in Celsius, and grant or reject access to a coffee shop. When a customer orders a
coffee, they have to choose a size such as Small, Medium, and Large then, depending on the
order, the price has to change. The price also has to change depending on the type of coffee.
For example, for coffees that are similar to espresso, you also need to take every shot of
espresso into account. The actual prices of the coffees depend on your imagination however,
they should be realistic.
Some hints:
• Focus on dividing your program into multiple functions.
• You can also return double or integer types of values from your functions, so use them if
you can.
• Don't just code a function every possible type of, and try to make it generic as much as
possible.
• Be creative. Fill the gaps using your imagination. This is an open ended lab work.
Expectations:
1. You will have milk, steamed milk, milk foam, and hot chocolate that can be ordered for a
specific type of coffee.
2. You will have two basic types of coffee, filter coffee, and espresso(Hint: Don't forget
about shots, that could be a measure for the price).
3. We are expecting your program to be able to order; Cappuccino, Latte, Mocha, Flat
White, or Filter Coffee. All of these are base types of orders, however, you can always
have extra milk or hot chocolate, so make sure you take that into account.
4. Customers are not allowed to enter if their body temperature is higher than 36.5 Celsius.
5. The user will enter integer values to select their options for everything in the program.
6. Add an exit option for the user so he/she can cancel the order.
7. The program should terminate if the customers try to order his/her 4th coffee.
Transcribed Image Text:In this lab work, you will implement a coffee shop example. In this coffee shop, everything must progress as if it does in real life. It means that the program should ask a person for body temperature in Celsius, and grant or reject access to a coffee shop. When a customer orders a coffee, they have to choose a size such as Small, Medium, and Large then, depending on the order, the price has to change. The price also has to change depending on the type of coffee. For example, for coffees that are similar to espresso, you also need to take every shot of espresso into account. The actual prices of the coffees depend on your imagination however, they should be realistic. Some hints: • Focus on dividing your program into multiple functions. • You can also return double or integer types of values from your functions, so use them if you can. • Don't just code a function every possible type of, and try to make it generic as much as possible. • Be creative. Fill the gaps using your imagination. This is an open ended lab work. Expectations: 1. You will have milk, steamed milk, milk foam, and hot chocolate that can be ordered for a specific type of coffee. 2. You will have two basic types of coffee, filter coffee, and espresso(Hint: Don't forget about shots, that could be a measure for the price). 3. We are expecting your program to be able to order; Cappuccino, Latte, Mocha, Flat White, or Filter Coffee. All of these are base types of orders, however, you can always have extra milk or hot chocolate, so make sure you take that into account. 4. Customers are not allowed to enter if their body temperature is higher than 36.5 Celsius. 5. The user will enter integer values to select their options for everything in the program. 6. Add an exit option for the user so he/she can cancel the order. 7. The program should terminate if the customers try to order his/her 4th coffee.
Expert Solution
Step 1

C program

#include<stdio.h>
#include<stdlib.h>
float a;
int b,c,d,e,f,sum=0;
void milk();

void milk()
{
printf("\nSelect milk: 1. Milk 2. Steamed Milk 3. Foam milk 4. hot Chocolate: ");
scanf("%d",&f);
switch (f)
{
case 1: sum=sum;
break;
case 2: sum=sum+20;

break;
case 3: sum=sum+30;
break;
case 4: sum=sum+40;
break;
default: printf("\nInvalid selection");
break;
}
}
int main()
{
printf("\nEnter your body temperature:");
scanf("%f",&a);
if(a<36.50)
{
printf("\nWELCOME");
}
else
{
printf("Due to precautionary measure access is denied!!");

exit(0);
}
printf("\nSelect your coffee 1.Cappacino 2. Latte 3. Mocha 4. Flat 5. White coffee 6.Filter Coffe 7. Black Coffee :");
scanf("%d",&b);
switch (b)
{
case 1: sum=100;
printf("\nHow many Espresso shots:");
scanf("%d",&c);
d=c*20;
sum=sum+d;
milk();
break;
case 2: sum=200;
printf("\nHow many Espresso shots:");
scanf("%d",&c);
d=c*20;
sum=sum+d;
milk();
break;
case 3: sum=300;
printf("\nHow many Espresso shots:");
scanf("%d",&c);
d=c*20;
sum=sum+d;
milk();
break;
case 4: sum=400;
printf("\nHow many Espresso shots:");
scanf("%d",&c);
d=c*20;
sum=sum+d;
milk();
break;
case 5: sum=500;
printf("\nHow many Espresso shots:");
scanf("%d",&c);
d=c*20;
sum=sum+d;
milk();
break;
case 6: sum=250;
break;
break;
case 7: sum=350;
break;
default: printf("\nInvalid selection");
break;

}
printf("TOTAL AMOUNT: %d",sum);
return 0;
}

steps

Step by step

Solved in 2 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