1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
stiv31 [10]
3 years ago
12

Write a program to calculate how much to tip a waiter person based on the quality of service. The script file should ask for the

amount of the check and whether the service was good, fair or poor. If the service was good, the tip should be 20%. If the service was fair, the tip should be 15%. If the service was poor, the tip should be 5%. The program should display the tip and the total of the check including the tip.
Computers and Technology
1 answer:
IgorC [24]3 years ago
5 0

Answer:

Since Python is a scripting language, here is code in python.

#prompt user to give check

amount=float(input("Please Enter the check:"))

#prompt user to give service

service=input("Please Enter the service (good, fair or poor):")

# calculate tip on the basis of service

if service =="good":

   tip=amount*0.2

elif service=="fair":

   tip=amount*0.15

elif service=="poor":

   tip=amount*0.05

#calculate total

total=amount+tip

#print tip

print("tip is equal to : {} ".format(tip))

#print total

print("total of the check is : {} ".format(total))

Explanation:

Prompt user to give check and service input.After taking the input from user, based on the service tip will be calculated. if service is "good" then tip will be 20% of the check, tip will be 15% if service is "fair" and tip will be 5% if service is "poor".

Output:

Please Enter the check:125                                                                                                

Please Enter the service (good, fair or poor):good                                                                        

tip is equal to : 25.0                                                                                                    

total of the check is : 150.0

You might be interested in
You run an automobile selling company that has a popular online store on AWS. The application sits behind an Auto Scaling group
vredina [299]

Answer:

We can achieve this by using cURL command and GET command.

Explanation:

<u>cURL command: </u>

  • cURL command is the command of the command line tools which are available on the following platforms such as Linux, Windows, Mac OS, and many other Operating Systems.
  • From the servers, cURL transfer the following data by using any of the protocol which are supported such as SFTP, HTTPS, HTTP, FTPS or many of the other protocols.

<u> </u>

<u>GET command: </u>

GET command is the function by which from the particular URL we can retrieve the resources.

8 0
3 years ago
Write a program that determines the price of a movie ticket (similar to the one in the chapter). The program asks for the custom
goblinko [34]

Answer:

#include <iostream>

using namespace std;

int main() {

int age,time;

float price;

cout<<"Enter age:";

cin>>age;

cout<<"Enter time(in 24 hour clock for noon 1200):";

cin>>time;

if(age>13){

if(time<1700){

price=5;

}else{

price=8;

}

}else{

if(time<1700){

price=2;

}else{

price=4;

}

}

cout<<"Price: $"<<price<<endl;

}

Explanation:

Okay, here are the steps to be taken in order to be able to Write a program that determines the price of a movie ticket as given in details in the question above. Therefore, checked the steps below;

==> Input the age and the time.

==> If the age is not greater than 13, input the time(that is <1700) and follow it by imputing the price.

And if the age is greater than 13, you will also need to input the price. Just as below;

#include <iostream>

using namespace std;

int main() {

int age,time;

float price;

cout<<"Enter age:";

cin>>age;

cout<<"Enter time(in 24 hour clock for noon 1200):";

cin>>time;

if(age>13){

if(time<1700){

price=5;

}else{

price=8;

}

}else{

if(time<1700){

price=2;

}else{

price=4;

}

}

cout<<"Price: $"<<price<<endl;

}

6 0
3 years ago
Ling has configured a delegate for her calendar and would like to ensure that the delegate is aware of their permissions. Which
const2013 [10]

Answer:

Tasks>Editor (B)

Explanation:

I just did the test

4 0
3 years ago
Read 2 more answers
Guys im getting the ps5 tomorrow :)​
Paha777 [63]

Answer:

lucky mf

Explanation:

5 0
2 years ago
Read 2 more answers
C:/Users/Documents/resume.docx Where is the "resume" document located in this file structure?
ASHA 777 [7]

Answer:

"resume.docx" is located in "Documents"

Explanation:

[<drive-letter:: represents drive name>]:/Main_Directory/Sub_Directory/ETC..

3 0
3 years ago
Other questions:
  • Imagine that you are an independent filmmaker making a feature-length narrative film in the United States, with a variety of bot
    11·2 answers
  • An important advantage of using GUI data-entry objects is that you often can control what users enter by limiting their options?
    6·1 answer
  • The ____ is a new feature in versions of microsoft office, starting with office 2007; it consists of tabs, which contain groups
    5·1 answer
  • Bulldog Holdings is a U.S.-based consumer electronics company. It owns smaller firms in Japan and Taiwan where most of its cell
    5·1 answer
  • Witch icon allows you to see paragraph formatting feature
    6·1 answer
  • Can you move it like this? I can shake it like that
    6·1 answer
  • Hey does anyone know the name of that movie where like this teenage girl is chilling at her house then there is an outbreak of s
    6·1 answer
  • Assert statements are a tool programmers employ to help them debug their code more efficiently.
    6·1 answer
  • What keys on the keyboard have the ability to move the cursor around on a window?
    11·1 answer
  • Which of the following helps you plan out every step of an animation?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!