Question

Create a C program that makes the decision(s) described in the scenario below. Code if and...

Create a C program that makes the decision(s) described in the

scenario below. Code if and else statements, with &&, ||, >, <, ==, and so on as needed to

implement your interpretation of the scenario you claimed.

Scenario:

I have only 30 minutes to take my lunch time. If I receive my food in less than or promptly at the 10-minute mark and the server was nice I am happy, if I received my food after 10 minutes but less than 15 minutes and the server was nice I will be anxious about the time. If I receive my food after 15 minutes but less than 20 minutes I will be upset. If I don’t receive my food after 20 minutes I will leave.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program for the above scenario.

#include <stdio.h>

int main()

{

int minute;

printf("How much time did it take to arrive your food? ");

scanf("%d"", &minute);

if (minute<=10)

printf(" Very good service. The customer is happy");

else if (minute>10 && minute<=15)

printf ("Good service but took some time.");

else if (minute>15 && minute<=20)

printf ("Bad service. Customer is upset");

else

printf (" Very bad service. Customer is leaving.");

return 0;

}

#include <stdio.h> 3 int main() 4int minute; 5 printf(How much time did it take to arrive your food?\n); 6 scanf(%d,&minuif else if ladder is used if the user needs to take decisions with one or more conditions. Here there are one or more conditions so if else if ladder is suitable for this.

Relational operators and logical operators(><=&&)are used to decide between conditional values to make final decision.

I think this program will work for you according to your question. Since there is no much information about the input to the program and all, I did my own contribution coding this. I think it will be helpful to you and is as you want it to be. If there's anything more you want to add, please mention it in comments. Pls rate if this was helpful to you. Thank you!

Add a comment
Know the answer?
Add Answer to:
Create a C program that makes the decision(s) described in the scenario below. Code if and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a Blue Print of the work flow described below             In this problem the kitchen and the bar operate in par...

    Create a Blue Print of the work flow described below             In this problem the kitchen and the bar operate in parallel, so this is considered below.             a. The capacity of each resource is as follows:             The service manager takes 2 minutes per order and can handle 30 orders per hour Each chef takes 16 minutes and can handle 60/16 = 3.75 orders per hour. There are 4 chefs so the kitchen can handle 4 X 3.75 = 15 orders per...

  • Question: Can someone please Help me with REWRITING and RESOLVING GRAMMER Errors that I made below...

    Question: Can someone please Help me with REWRITING and RESOLVING GRAMMER Errors that I made below by using Scholarly writing style, Grammar, APA format.? I really enjoyed spending my time in adult day care. I did certain activities like having a good therapeutic communication with my clients. By trying to Sing Indian chants with them. Also, I tried to use my communication skills and being empathetic with one of the clients who was suffering from hospice care.   My impression for...

  • please read the scenario and answer each of the questions the questions below in a typed...

    please read the scenario and answer each of the questions the questions below in a typed form PMH: Ms. Lupin has a history of early onset dementia, atrial fibrillation, COPD, insulin-dependent DM, an MI, a pacemaker, and an ORIF of a left hip fracture in 2011. Social History: Ms. Lupin lives alone in a 2-story home. She has 2 cats. Her primary source of support is her neighbor. HPI: Ms. Lupin was admitted to the hospital with dehydration secondary to...

  • Major Homework #2 Implement a C program major_hw2.c to solve the 15-puzzle problem using the A* s...

    Major Homework #2 Implement a C program major_hw2.c to solve the 15-puzzle problem using the A* search algorithm. Please include pictures that the code runs and shows the different states as it reaches goal state please. 1. Objectives • To gain more experience on using pointers and linked lists in C programs. • To learn how to solve problems using state space search and A* search algorithm. 2. Background A* search and 15-puzzle problem have been introduced in the class....

  • This is a c++ program. Use the description from Parking Ticket Simulator (listed below) as a basis, where you need to...

    This is a c++ program. Use the description from Parking Ticket Simulator (listed below) as a basis, where you need to create a Car class and Police Officer class, to create a new simulation. Write a simulation program (refer to the Bank Teller example listed below) that simulates cars entering a parking lot, paying for parking, and leaving the parking lot. The officer will randomly appear to survey the cars in the lot to ensure that no cars are parked...

  • please read the scenario and answer each of the questions the questions below in a typed form I just need idea or inform...

    please read the scenario and answer each of the questions the questions below in a typed form I just need idea or information how to answer the questions then I will document it online. PMH: Ms. Lupin has a history of early onset dementia, atrial fibrillation, COPD, insulin-dependent DM, an MI, a pacemaker, and an ORIF of a left hip fracture in 2011. Social History: Ms. Lupin lives alone in a 2-story home. She has 2 cats. Her primary source...

  • Programming in C. Name this program schwifty.c - This program reads a text file and makes...

    Programming in C. Name this program schwifty.c - This program reads a text file and makes it schwifty, but the user determines the schwiftiness. The user supplies the filename to schwift and a string containing a sequence of the following characters to determine the schwiftiness via command line arguments: L - Left shift each character in a word: hello --> elloh R - Right shift each character in a word: elloh --> hello I - Shift the letters' and digits'...

  • 3. Process perspectives on motivation (Connect, Perform) Read the short scenario below. Then use your understanding...

    3. Process perspectives on motivation (Connect, Perform) Read the short scenario below. Then use your understanding of expectancy theory to diagnose the particular employee's barrier to performance Management at Work You are a manager at a company with a written compensation plan that outlines how employees will be paid for performance. When employees get higher annual performance ratings, they will get larger increases in their base pay. Also, when the company achieves certain goals each year, such as hitting earnings...

  • Please help, need to code for this business assignment using c++. Business Expense Reimbursements Calculator Probl...

    Please help, need to code for this business assignment using c++. Business Expense Reimbursements Calculator Problem statement: Business trip is part of the enterprise culture. Suppose a businessperson just completed a business trip for your company. Now, you are tasked to write a program that calculates and displays the total travel expenses, allowable expenses for the trip, and the excess that must be paid by the businessperson, if any The program should prompt the user for the following . The...

  • Recall in the one sample hypothesis testing scenario that we investigated the following presumpti...

    Recall in the one sample hypothesis testing scenario that we investigated the following presumptions based on previous research, "no evidence currently exists supporting or refuting the use of electric fans during heat waves" in terms of mortality and illness, as well as Public Health guidelines suggesting not using fans during hot weather, with some research reporting the potential of fans accelerating body heating. You decide to further your research project by hypothesizing that the true proportion of core body temperature...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT