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
lbvjy [14]
3 years ago
15

Write a program that calculates the total amount of a meal purchased at a restaurant by a customer. The program should ask the u

ser to input the charges of the food, then calculate the amounts of a 18% tip and 7 % sales tax. Display each of these amounts and total charges.
Computers and Technology
1 answer:
Illusion [34]3 years ago
7 0

Answer:

Python script is given below

Explanation:

charge = float(input('Enter the amount you were charged. $'))

#setting the formula for tip and tax

tip = charge*.18

tax = charge*.07

#printing the values

print('Charge for the food: %.2f' % charge)

print('The tip amount: %.2f' % tip)

print('Tax amount: %.2f' % tax)

print('Total amount: %.2f' % (charge+tip+tax))

You might be interested in
Write a loop that continually asks the user what pets the user has until the user enters rock in which case the loop ends. It sh
mote1985 [20]

Loops are program statements that are repeated as long as the loop condition is true.

The loop in Python, where comments are used to explain each line is as follows:

#This initializes the number of pets to 0

count = 0

#This gets input for the pet name

pet = input("Pet: ")

#This is repeated until the user enters "rock"

while pet.lower() != "rock":

   #This increases the number of pets by 1

   count+=1

   #This prints the pet and the number of pets

   print("You have a",pet,"with a total of",str(count),"pet(s)")

   #This gets input for the pet name

   pet = input("Pet: ")

Read more about loops at:

brainly.com/question/19344465

6 0
2 years ago
Which statement is true?
Alexeev081 [22]

Answer:

Bjarne Stroustrop published the first reference guide for C++

Explanation:

Bjarne Stroustrop is a computer scientist who created the C++ programming language while working at the AT&T Bell laboratory. He also published the first reference guide for the programming language.

In October 1985, the book, The C++ Programming Language, was published. It describes the c++ programming language and was the only documentation and reference guide for the programming language at the time. Newer editions have since been published.

7 0
3 years ago
Read 2 more answers
The ________ utility automatically creates duplicates of your libraries, desktops, contacts, and favorites to another storage lo
umka21 [38]

Answer: File History

Explanation: File history is the history that gets created in the form of back-up that keeps the record of the stored files. It is used in protecting the files  that is present on the system like desktop, libraries,etc.

It creates the duplicate records in the storage for any future use and it can also be restored easily.File history also facilitates with feature of deleting the unnecessary history afterward when the user wants.

6 0
2 years ago
The average pH of citrus fruits is 2.2, and this value has been stored in the variable avg_citrus_pH . Provide a statement to di
olasank [31]

Answer:

The statement in Python is:

print("The average pH of citrus fruits is ",avg_citrus_pH)

Java

System.out.print("The average pH of citrus fruits is "+avg_citrus_pH);

C++

cout<<"The average pH of citrus fruits is "<<avg_citrus_pH;

Explanation:

The programming language is not stated; so, I answered the question in 3 languages (Python, Java and C++)

Assume that avg_citrus_pH has been declared and initialized; all you need to do is invoke a print statement and then append the variable

In Python, use print()

In c++, use cout<<

In Java, use System.out.print()

So, the statements are:

Python:

print("The average pH of citrus fruits is ",avg_citrus_pH)

Java

System.out.print("The average pH of citrus fruits is "+avg_citrus_pH);

C++

cout<<"The average pH of citrus fruits is "<<avg_citrus_pH;

8 0
2 years ago
A small program that sends itself to other computers, rather than relying on user actions, is a
PSYCHO15rus [73]

Virus.

A virus is a malicious program or script that Spreads. 

Malware, however, will not spread. 

Viruses can spread without a victim's permission because it is automated to do so. 

For example, the Melissa virus would look like a file attachment that used reverse psychology to make you open it. From there, it goes through the first 50 email contacts stored on your computer and sends the virus to them from your computer. 
8 0
3 years ago
Other questions:
  • A(n) ____ tag is used to let the compiler know that your intention is to override a method in a parent class
    10·1 answer
  • when you create workplace documents, it is most important to ensure that they are clear, professional, and a. short. b. informal
    7·1 answer
  • In order for Dr. Reynolds to send a CPOE from her office computer system to the computer system at the local hospital, a/an ____
    5·1 answer
  • __________________ ensures that each row is uniquely identified by the primary key, which means that a proper search for an exis
    10·1 answer
  • Which of these is most closely associated with system control? (1 point) (Points : 1.5) boundary
    10·1 answer
  • Managers looking for advice on properly dealing with obsolete technology hardware can: a) consult the e-Stewards program b) seek
    9·1 answer
  • Given the scenario, before leaving the office, you ask the CIO to provide which formal document authorizing you to perform certa
    11·1 answer
  • Intranets:
    8·1 answer
  • In his digital portfolio, Ben wants to locate each work he created. Where can he list details about the work in his digital port
    7·2 answers
  • When an EC2 instance is being modified to have more RAM, is this considered Scaling Up or Scaling Out?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!