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.

Answers

Answer 1
Answer:

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


Related Questions

A proper divisor of a positive integer $n$ is a positive integer $d < n$ such that $d$ divides $n$ evenly, or alternatively if $n$ is a multiple of $d$. For example, the proper divisors of 12 are 1, 2, 3, 4, and 6, but not 12. A positive integer $n$ is called double-perfect if the sum of its proper divisors equals $2n$. For example, 120 is double-perfect (and in fact is the smallest double-perfect number) because its proper divisors are 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 24, 30, 40, and 60, and their sum is 240, which is twice 120. There is only one other 3-digit double-perfect number. Write a Python program to find it, and enter the number as your answer below.
Assume there is a machine with the IP address 129.82.102.63 with netmask /23, and with a parent NW whose netmask is 255.255.224.0. For each answer, do not include any spaces, give full IP addresses/netmasks where these are requested, give the "/" as part of the answer for slash notation.
What type of malicious software masquerades as legitimate software to entice the user to run it?
Describe the components of Computer-based informationsystems.
Select the true statement(s) regarding a virtual circuit. a. both analog and digital networks take advantage of the virtual circuit concept b. virtual circuits require the assignment of dedicated physical links during network connection c. regarding the efficient use of physical links, virtual circuits are more efficient than analog circuits d. both a and b are true statements"

In dealing with facial recognition technology, what term describes the rate at which imposters are recognized as legitimate users?

Answers

Answer:

CER

Explanation:

The CER refers to equanimity between an identification technology's False Acceptance Rate and its False Rejection Rate, which is “the best summary measure of face recognition technologies' efficacy,” according to a statement from Applied Recognition.

A LAN Uses category 6 cabling. An issue with the connection results in network link to get degeneration and Only one device can communicate at a time. What is the connection operating at?Half duplex
Simplex
Partial
Full Duplex

Answers

Answer:

partial

Explanation:

Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Else, if givenYear is 2001 or greater (2001-2100), print "21st century".

Answers

Answer:

import java.util.Scanner;

public class num9 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter year");

       int givenYear =in.nextInt();

       if(givenYear>=2101){

           System.out.println("Distant Future");

       }

       else if(givenYear>=2001){

           System.out.println("21st Century");

       }

   }

}

Explanation:

  • Using Java programming Language
  • Import Scanner class to receive user input of the variable givenYear
  • Use if statement to check the first condition if(givenYear>=2101)
  • Use else if statement to check the second condition if(givenYear>=2001)
  • print Distant future and 21st century respectively

What are the similarities and differences between the editor-in-chief, managing editor, assignment editor, and copyeditor? Your response should be at least 150 words.

Answers

Answer:

Editor. An editor is the individual in charge of a single publication. It is their responsibility to make sure that the publication performs to the best of its ability and in the context of competition. A managing editor performs a similar role, but with greater responsibility for the business of the publication.

Explanation:

This quiz is meant to test your understanding of secure passwords. Click on the title and answer the following questions in the submission box: What are the characteristics of a secure password? Why is phishing harmful?

Answers

Answer:

A secure password has the following characteristics:

  • long - it should be more than 15 characters
  • mix of characters - it should composed of letters (uppercase and lowercase), numbers and symbols
  • don't use dictionary word - avoid using common words such as "orange", "password"
  • don't use memorable key paths - avoid using the sequential letter or numbers such as "abc123"

Phishing is a kind of social engineering where a cyber criminals  trying to trick the victims to get benefit from them. For example, a cyber criminal can send a phishing email to tell the victims about something wrong with their credit card or bank account and provide a malicious link and persuade the victim to access their fake website that resembles an official bank website.  From there, the victims can send credential info to the cyber criminals without their awareness. Phishing can also be done through phone call. Phishing is harmful as a victim can fall into the trap of disclosing highly critical credential info that incur a huge loss of money.

You are installing several servers that will be used as web servers to reach customers over the Internet. Where should you place the servers?proxy area

DMZ

internal network

external network

Answers

Answer: DMZ

Explanation:

 DMZ is the demilitarized zone network and it is use in providing he various services to the users or customers by using the public internet. It basically contain organizational services in the logical and physical sub-network and usually works in large network.

The main purpose of DMZ that it is use as web server over the internet for reaching to the users and customers. It also add one additional layer in the organization for security purpose.

Some of the services that DMZ provides as web server, DNS and proxy server.  

Other Questions