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

mips Write a program that asks the user for an integer between 0 and 100 that represents a number of cents. Convert that number

of cents to the equivalent number of quarters, dimes, nickels, and pennies. Then output the maximum number of quarters that will fit the amount, then the maximum number of dimes that will fit into what then remains, and so on. If the amount entered is negative, write an error message and quit. Amounts greater than 100 are OK (the user will get many quarters.) Use extended assembly instructions and exception handler services.
Computers and Technology
1 answer:
Mumz [18]3 years ago
8 0

Answer:

Explanation:

The following code is written in python and divides the amount of cents enterred in as an input into the correct amount of quarters, dimes, nickels and pennies. Finally, printing out all the values.

import math

#First we need to define the value of each coin

penny = 1

nickel = 5

dime = 10

quarter = 25

#Here we define the variables to hold the max number of each coin

quarters = 0

dimes = 0

nickels = 0

pennys = 0

cents = int(input("Please enter an amount of money you have in cents: "))

if cents > 0 and cents <= 100:

   if cents >= 25:

       quarters = cents / quarter

       cents = cents % quarter

   if cents >= 10:

       dimes = cents/dime

       cents = cents % dime

   if cents >= 5:

       nickels = cents /nickel

       cents = cents % nickel

   if cents > 0:

       pennys = cents / penny

       cents = 0

   print("The coins are: "

       "\nQuarters", math.floor(quarters),

       "\nDimes", math.floor(dimes), "\nNickels", math.floor(nickels), "\nPennies", math.floor(pennys))

else:

   print("wrong value")

You might be interested in
LaShawn would like to post photos in a social media app, but the program needs to be modified in order to display a greater vari
Natasha2012 [34]

Answer:

Increase the colour depth

Explanation:

Increasing the depth will increase the amount of space required to store the image, but will result in better image quality in return. The question is pretty vague because this is the only reasonable answer which I could think of.

7 0
3 years ago
Read 2 more answers
If you want the values in your cell to have dollar signs in front of them, _________
Vlad1618 [11]
Use the number formatting option
4 0
3 years ago
FOR CALL OF DUTY MOBILE GAMERS PLS HELP!
statuscvo [17]

since the app are two different things its crucial to have a activision account, though the progress wont be reset unless you do have an activision account

8 0
2 years ago
A growling noise is heard only when the driver exerts force on the clutch pedal. No noise is heard when the clutch pedal is up.
frosja888 [35]
Technician B is correct when you can hear growling only when the driver exerts force on the clutch pedal but not when it is up the Shaft Bearing is defective


3 0
3 years ago
________ tv uses a digital signal, or series of 0s and 1s, and is much clearer and less prone to interference than analog tv. re
vagabundo [1.1K]
Digital TV uses a digital signal, or series of 0s and 1s, and is much clearer and less prone to interference than analog TV.<span> It improves reception, offers better picture and sound quality, </span>
In analog television, in which the video and audio are carried by analog signals. In digital they are carried with digital encoding. 
4 0
4 years ago
Other questions:
  • In Word you can _____ or merge two different copies of the same document into one document. a. replicate b. duplicate c. copy d.
    11·1 answer
  • When considering the best technology for its particular use what should a business consider
    8·2 answers
  • Write a function called line_numberthat takes as parameters two strings representing file names. Assume these are text files. Th
    15·1 answer
  • What command can be used to export an nps backup file named npsconfig.xml that can be used to restore nps configuration on anoth
    12·1 answer
  • What technology habit you practice every day that you need to stop to be more successful?
    13·1 answer
  • How do mass and social media differ
    8·1 answer
  • The formula for calculating your BMI is below. BMI=703weight in pounds(height in inches)2 Which line of code will correctly calc
    8·1 answer
  • What are the characteristics of calendar sharing options in Outlook 2016? Check all that apply.
    13·2 answers
  • Decomposition is
    5·1 answer
  • When scriptwriters are writing scripts, why do they have to write them in accordance with industry standards?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!