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
Fittoniya [83]
3 years ago
11

Calculator Create a program that calculates three options for an appropriate tip to leave after a meal at a restaurant.

Computers and Technology
1 answer:
dsp733 years ago
4 0

Answer:

I am writing a Python program:

print("Tip Calculator \n")

bill = float(input("Cost of meal: "))

tip15pc = bill * 0.15

tip20pc = bill * 0.20

tip25pc = bill * 0.25

print("\n15%")

print("Tip amount: %.2f"% (tip15pc))

print("Total amount: %.2f \n" % (bill + tip15pc))

print("20%")

print("Tip amount: %.2f"% (tip20pc))

print("Total amount: %.2f \n" % (bill + tip20pc))

print("25%")

print("Tip amount: %.2f"% (tip25pc))

print("Total amount: %.2f" % (bill + tip25pc))

Explanation:

The program first prints the message: Tip Calculator

bill = float(input("Cost of meal: ")) This statement prompts the user to enter the amount of the bill of meal. The input value is taken as decimal/floating point number from user.

tip15pc = bill * 0.15  This statement calculates the cost of tipping at 15%

tip20pc = bill * 0.20 This statement calculates the cost of tipping at 20%

tip25pc = bill * 0.25 This statement calculates the cost of tipping at 25%

print("\n15%")  This statement prints the message 15%

print("Tip amount: %.2f"% (tip15pc))  this statement displays the amount of tip at 15% and the value is displayed up to 2 decimal places as specified by %.2f

print("Total amount: %.2f \n" % (bill + tip15pc))  This statement prints the total amount by adding the cost of mean with the 15% tip amount.

The program further computes the the amount of tip at 20% and 25%. The resultant values are displayed up to 2 decimal places as specified by %.2f Then the program prints the total amount by adding the cost of mean with the 20%  and 25% tip amounts just as computed for the 15% tip.

The screenshot of the program as well as its output is attached.

You might be interested in
Suppose we are sorting an array of eight integers using quicksort, and we have just finished the first partitioning with the arr
Mila [183]

Answer:

c. The pivot could be either 7 or 9.

Explanation:

Since we are trying to sort an array of eight integers using quick sort, from the first partitioning it shows that the pivot or the central point can either be 7 or 9. When you look at the array, it is only 7 and 9 that are placed correctly in the sorted array. Every element to the left of 7 and 9 are smaller and every element on the right of 7 and 9 are integers higher than them. Hence this shows that the pivot lies between 7 or 9.

6 0
3 years ago
What is ODBC? How is it related to SQL/CLI? 10.2. What is JDBC? Is it an example of embedded SQL or of using function calls? 10.
tamaranim1 [39]

Answer:hhhhhhhhh

Explanation:

5 0
3 years ago
What is the next line?
Contact [7]

The right answer is option 4: 2

Explanation:

Lists are used in Python to store elements of same or different data types.

Different functions are used in Python on List. One of them is count.

Count is used to count how many times a specific value occurs in a list.

The syntax for count is:

listname.count(value)

In the given code,

The output will be 2

Hence,

The right answer is option 4: 2

5 0
3 years ago
Name any two objectives of a business​
olga nikolaevna [1]

Explanation:

Growth – Another important objective of business is to achieve growth. The growth should be in terms of increase in profit, revenue, capacity, number of employees and employee prosperity, etc.

Stability – Stability means continuity of business. An enterprise or business should achieve stability in terms of customer satisfaction, creditworthiness, employee satisfaction etc. A stable organization can easily handle changing dynamics of markets.

6 0
3 years ago
Students at a residence hall are reporting internet connectivity issues. The university’s network administrator configured the r
alisha [4.7K]

Answer: D) DHCP snooping

Explanation:

 DHCP stand for the dynamic host configuration protocol and it is basically use as the DHCP server. It provide the IP address to each device in the network and it is used to communicate with the other IP network.

According to the question, the student device basically receive the IP network and it is an unauthorized DHCP server which uses denial of service attack for several purposes.

DHCP snooping is basically use to prevent from such unauthorized device which gives the IP address to the clients. DHCP is the two layer security system technology that is bulit in the operating system.

7 0
3 years ago
Other questions:
  • A device that modulates digital data onto an analog signal and then demodulates the analog signal back to digital data is a ____
    8·1 answer
  • Are video games considered information technology
    9·2 answers
  • ____ errors occur when a formula is written incorrectly, when a mistake is made with a decision condition, or when the wrong var
    11·1 answer
  • All resources are limited. Which of the following is NOT a resource?
    11·1 answer
  • Assume that two arrays are parallel. Assume the first array contains a person's id number and the second contains his or her age
    5·1 answer
  • . Is it conceivable to design a secure operating system for these computer systems? Give arguments for and against.
    6·1 answer
  • Use NAND operator to write; P or Q, and P -Q make an everyday implication sentence using only NAND
    14·1 answer
  • You are about to repair and change the resistor (small components),but the components are too small to solder and hold,what tool
    12·1 answer
  • For which input values will the following loop not correctly compute the maximum of the values? 1. Scanner in = new Scanner (Sys
    14·1 answer
  • Explain why this scenario could put an organization in jeopardy of losing some of its workforce.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!