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
I have been trying to work on this for a while now, and this is on excel
cluponka [151]

Answer:

=IF(INDEX(INDIRECT(C10), B10)=0,"",INDEX(INDIRECT(C10), B10))

Or

=IF((INDEX((INDIRECT(Dept,TRUE)),Reason))="","",(INDEX((INDIRECT(Dept,TRUE)),Reason)))

Explanation:

Given

Your formula:.

=INDEX(INDIRECT("Dept"),Reason)

Dept column = C (C10)

Reason field = B (B10)

The issue with your formula is that you failed to include a statement to test the falsity of the first condition; in other words, if your if statement is not true, what else should the formula do.

The question says that

"Nest the function inside an IF function so that issues currently displaying as a 0 will display as a blank cell" this means that

if the INDEX() function returns 0, a blank should be displayed in H10 blank, instead.

So, the right formula both of these two. You can use any of them

1. =IF(INDEX(INDIRECT(C10), B10)=0,"",INDEX(INDIRECT(C10), B10))

2. =IF((INDEX((INDIRECT(Dept,TRUE)),Reason))="","",(INDEX((INDIRECT(Dept,TRUE)),Reason)))

The two does the same function; the only difference is that

(1) considers the cell itself while (2) considers the contents of the cell.

The analysis of both is that

They both use a nested indirect reference to check for the content of cells displaying 0.

The first if checks for the above mentioned; if yes, cell H10 is made to display a blank else it's original content is displayed.

8 0
3 years ago
Computer simulations were first developed during __________<br> as a part of the _____________
Effectus [21]

Answer:

WWII; Manhattan Project.

Explanation:

Computer simulation refers to a mathematical model designed and developed to predict the outcome or behavior of a hypothetical or real-life scenario on a computer system, so as to illustrate and understand how the system functions.

Historically, computer simulations were first developed during World War II (WWII) as a part of the Manhattan Project.

For example, SimpleScalar refers to a computer architectural simulating software application or program which was designed and developed by Todd Austin at the University of Wisconsin, Madison, United States of America. It is an open source simulator written with "C" programming language and it's used typically for modelling virtual computer systems having a central processing unit (CPU), memory system parameters (hierarchy), and cache.

6 0
2 years ago
Jerry has received an email on his company’s email system. The email is in regard to a new update the company plans to implement
Alla [95]

Answer:

The type of attack is <em>Phising Email.</em>

<em />

Explanation:

Phishing emails are mails purportedly sent by a company staff seeking some vital information from an employee or employees. Criminals often use such method to get sensitive information about a company and its details from its own employees who may not be able to differentiate such mails from the normal company mails. Thus the mail that Jerry receives regarding a new update the administrators of his company intends to implement can be regarded as a Phishing email.

5 0
3 years ago
What document type would be best to communicate sales items from a business to potential customer?
Mandarinka [93]

Answer: Flyer

Explanation: A flyer is a type of advertisement that is used to give out information about a certain product, event, or business. This can help communicate with potential customers.

8 0
3 years ago
Write 4 types of viruses , explain them briefly.
wariber [46]

I can help with two.

Web Scripting Virus, A sneaky virus that targets popular websites. What this virus does is overwrite code on a website and insert links that can install malicious software on your device. Web scripting viruses can steal your cookies and use the information to post on your behalf on the infected website.

FILE INFECTOR, targeting executable files (.exe), file infector viruses slow down programs and damage system files when a user runs them.

8 0
2 years ago
Other questions:
  • When does a kernel panic occur?
    12·2 answers
  • On laptops, wireless cards tend to be attached to which panel?
    8·1 answer
  • Science is a body of knowledge that extends back to Select one: a. the time of Galileo. b. Italy in the 16th century. c. Greece
    6·1 answer
  • Explain briefly the purpose of the Computer Management Console in Microsoft Windows.
    12·1 answer
  • Leonardo is having difficulty accessing the course website. he should contact the for assistance. (points:1)
    13·1 answer
  • (I made this up teehee) what anime is katski bakugo from
    15·2 answers
  • A unique ability of people which sets them far apart from animals is:
    8·1 answer
  • What is the output by the code system.out.print(8-4+2);
    13·1 answer
  • Lesson 2.7 Code Practice #2
    13·1 answer
  • you are asked to create a four-digit code using the numbers from 1 to 9. how many possible codes are there--assuming that number
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!