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

Write a Python program that prompts the user for the cost of two items to be purchased. Then prompt the user for payment. If the

amount entered is less than the total cost of the two items, print a message that states how much is still owed. Otherwise, print a thank you message and state how much change will be given.
Computers and Technology
1 answer:
Rama09 [41]3 years ago
7 0

Answer:

first_item = float(input("Enter the cost of your first item: "))

second_item = float(input("Enter the cost of your second item: "))

total = first_item + second_item

payment = float(input("Enter the amount you will be paying: "))

if payment < total:

   print("You still owe: " + str(total - payment))

else:

   print("Thank you. You will receive " + str(payment - total))

Explanation:

- Get the item costs from the user

- Calculate the <em>total</em>

- Get the <em>payment</em> from the user

- Compare the <em>payment</em> and <em>total </em>and print the appropriate message

You might be interested in
Ask the user to enter a number n &gt;= 1. There after the user will enter n-1 distinct integers between 1 and n. Thus, the enter
snow_tiger [21]

Answer:

Code below

Explanation:

n = int(input('Please enter n: '))#take input n

print('please enter the numbers')#print enter the numbers

total = 0 #intially take total as 0

original_total = 1 #intially take original_total=1

for i in range(2, n+1): #take the range 2 to n+1

total += int(input('Please enter a number: ')) # add total and enter the number

original_total += i

missing = original_total - total #you got missing number original_total - total

print('The missing number is: ' + str(missing)) # print missing number in the given data

3 0
3 years ago
1. List three tabs that make up the Ribbon
Roman55 [17]

Answer:

To create actions panes

On the Project menu, choose Add New Item.

In the Add New Item dialog box, select ActionsPaneControl, and then choose Add.

The ActionsPaneControl1.cs or ActionsPaneControl1.vb file opens in the designer.

From the Common Controls tab of the Toolbox, add a label to the designer surface.

In the Properties window, set the Text property of label1 to Actions Pane 1.

Repeat steps 1 through 5 to create a second actions pane and label. Set the Text property of the second label to Actions Pane 2.

Explanation:

hope it helps

3 0
2 years ago
Write a c++ function, largestnum, that takes as parameters a double array and its size and returns the index of the last occurre
miv72 [106K]
Not a Question so how am i supposed to help with this problem
6 0
2 years ago
Is it safe to turn on a computer without ram?
swat32
Well, it is safe to turn a computer on without a RAM, but you can't really do it. RAM is one of the essential components in computers without which you can't really use a computer. You can turn it on, however, nothing will appear on your screen and the system won't boot. So, technically, it is safe, but it won't do anything to your computer as it cannot run without RAM.
4 0
3 years ago
Read 2 more answers
Question #6
Vitek1552 [10]

Answer:

ValueError

Explanation:

Required

Determine the error the program returned

The above will return a ValueError error and the reason is as follows.

The first line of the program initializes variable as 'live'.

The next line tries to convert answer to integer and this is where it returns the error'.

On the second line, variable amount expects that the answer variable to contain number e.g. '567' but because it doesn't contain a complete number (i.e. unexpected values), the program returns a ValueError.

7 0
3 years ago
Read 2 more answers
Other questions:
  • When you enter a two-digit year that is less than 30, Excel changes the year to _____. Question 7 options:
    7·1 answer
  • Which of the following is the final fate for average sized stars?
    12·1 answer
  • Assume that isIsosceles is a bool variable, and that the variables isoCount, triangleCount, and polygonCount have all been decla
    11·1 answer
  • Write and run a Python program that asks the user for a temperature in Celsius and converts and outputs the temperature in Fahre
    10·1 answer
  • How will you create an email id
    11·1 answer
  • Write the definition of a function named averager that receives a double parameter and returns-- as a double -- the average valu
    11·1 answer
  • What devices gives input​
    5·1 answer
  • What is the best way of farming exotics in destiny?
    12·2 answers
  • You have a technical interview for a new position in digital media. One of the questions you are asked is this: “A client asks y
    13·1 answer
  • given 2,4,3,-1 as input, what is the output for the following program:total_product = 1 user_value = int(input()) while user_val
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!