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
Write a MATLAB script m-file to compute the ISS given an array of 6 AIS scores, which represent the most severe injuries to each
Dmitrij [34]

Answer:

The Matlab code is as given in the explanation, paste the code in the new script file, save it and run.

Explanation:

The code is as follows

Code:

<em>%% Initialization of the code</em>

<em>% The code takes an array of six AIS scores of the form [AIS1 AIS2 AIS3</em>

<em>% AIS4 AIS5 AIS6] of order 1x6.</em>

<em>AIS=input('Please enter the AIS array of the form [AIS1 AIS2 AIS3 AIS4 AIS5 AIS6]');%taking input of the array</em>

<em>AISs=sort(AIS,'descend');%sorting the array in the descending order</em>

<em>iss=(AISs(1,1)^2)+(AISs(1,2)^2)+(AISs(1,3)^2);%Calculating the ISS</em>

<em>disp(['The injury severity score (ISS) for the entered array is ', num2str(iss)])%Displaying the output</em>

Output:

<u><em>Please enter the AIS array of the form [AIS1 AIS2 AIS3 AIS4 AIS5 AIS6][3 0 4 5 3 0];</em></u>

<u><em>The injury severity score (ISS) for the entered array is 50</em></u>

<u><em /></u>

4 0
3 years ago
What is the difference between keywords and identifiers in c++ ?
prohojiy [21]
Keywords are the reserved words of a language.Identifiers are the user defined names of variable, function and labels. Hope that this helped
3 0
2 years ago
Mobile cameras are now of a higher quality than when they first arrived on the market. Describe the difference in
Anvisha [2.4K]

Answer:

When mobile cameras first arrived on the market, they did not have a high-quality resolution. But after the years, mobile cameras are able to record a significant amount of digital information.

6 0
2 years ago
Which is not a category of business or industry covered under OSHA standards? A. Construction B. General Industry C. Maritime D.
cestrela7 [59]
The answer from the given option is "D", "<span>OSHA covers all categories of business and industry".


OSHA stands for </span>Occupational Safety and Health Administration, which is an agency of the United States Department of Labor. The four categories of business and industry that are covered by the standards are general industry, maritime, construction and agriculture. So the the answer from the given options is D, because a, b and c are included in the categories.
5 0
2 years ago
What is the difference between building a table in word and excel
Anastasy [175]

Answer:

 The main difference between creating a table in word and excel is that there are more number of table tool and the layout section in the excel as compared to the MS word.

Creating a table in word or excel are only depend on the requirements of the particular table. If there is less number of calculations in the table then, it is easy to create the table in word as compared to excel.

And if we want to create a table with maximum numbers of rows and column and also contain high math calculation then, it is good to create in excel.

7 0
2 years ago
Other questions:
  • What is thought to have caused the extinction of the dinosaurs?
    13·1 answer
  • If you're unsure of what chart to use for a set of data, what feature does Excel include that will help you to decide?
    7·1 answer
  • You want to copy data from one cell or range to an adjacent cell or range in your spreadsheet, without using a shortcut key. Whi
    10·1 answer
  • You attempt to telnet to system 192.168.1.240. You receive the following message: "Connecting To 192.168.1.240...Could not open
    5·1 answer
  • Help me plz What character must always be used when a formula is enter in a cell? (on a spreadsheet)​
    11·1 answer
  • Laptop computers use PCMCIA cards, another type of ________
    15·1 answer
  • Which phrases in the passage provide clues that trifling means "silliness” or "insignificance”? Check all that apply.
    12·1 answer
  • When testing a game, why might you consider throttling the game’s “frames per second”?
    9·1 answer
  • Determine the value of a and b at the end of the following code segment:
    12·1 answer
  • True of false that the memory of laptop is normally measured in kilobytes
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!