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
Write a program that reads in a text file, infile.txt, and prints out all the lines in the file to the screen until it encounter
ivanzaharov [21]

Answer:

Explanation:

f=open("infile.txt","r")

flag=True

while(flag):

s=f.readline().strip()

if(len(s)>=4):

print(s)

else:

flag=False

8 0
2 years ago
You have probably heard of wearable fitness devices, such as FitBit. What new products do you think might exist in this field in
tino4ka555 [31]

The new products in this fitness field in a decade are:

  • TRX Home2 System.
  • Rogue Rubber Coated Kettlebells.
  • Stamina Adjustable Kettle Versa-Bell, etc.

<h3>What is the use of artificial intelligence in fitness?</h3>

AI is known to be in the field of wellness and also fitness as it has made product such as:

  • GOFA Fitness that uses GPS.
  • 3D motion tracking technology.
  • Machine learning to give users with live feedback when in a workouts, etc.

Therefore, The new products in this fitness field in a decade are:

  • TRX Home2 System.
  • Rogue Rubber Coated Kettlebells.
  • Stamina Adjustable Kettle Versa-Bell, etc.

Learn more about fitness from

brainly.com/question/1365564

#SPJ1

5 0
2 years ago
The development team recently moved a new application into production for the accounting department. After this occurred, the Ch
Gnesinka [82]

Answer:

B

Explanation:

User Acceptance Testing (UAT) is the testing done by end users who is going to use that application. In these testing they will test  whether the application meets all the functional requirements of the end user. If it passed then only the application will move to the production. This will ensure that the application meets the user requirements before it put into the usage.

The Answer is B

5 0
3 years ago
File "f2" has a size of 2. Why? A. It contains the string "f1". B. It contains two blank lines.
Aneli [31]

Answer:

A. It contains the string "f1"

7 0
3 years ago
Consider this query:
vlabodo [156]

Answer:

There is a table in the database named Teacher having columns Email, Expiry Month etc. this query is selecting the email address from the table Teachers on the basis of expiry month that is February.\  

Explanation:

4 0
3 years ago
Other questions:
  • A cell reference that has only one $ is referred to as a(n) ____ cell reference. alternative mixed relative absolute
    7·1 answer
  • i see tabs named mowed and Ramsey i tried shredding them and deleting them and ending all the processes but they start duplicati
    13·1 answer
  • Three variables, x, y and z, supposedly hold strings of digits, suitable for converting to integers. Write code that converts th
    13·2 answers
  • A researcher wants to do a web-based survey of college students to collect information about their sexual behavior and drug use.
    15·1 answer
  • Select the correct answer.
    10·2 answers
  • A tracking signal A. is computed as the mean absolute deviation​ (MAD) divided by the running sum of the forecast errors​ (RSFE)
    10·1 answer
  • If cells A1=90,A2=85,A3=80,A4=75, A5=75.What will be the formula if you are going to get the formula total
    5·1 answer
  • Question 21 pts How many lines should an email signature be? Group of answer choices "5 to 6" "7 to 8" "1 to 2" "3 to 4"
    10·1 answer
  • What is an outcome in a game? Don't search google just give me an answer
    9·1 answer
  • Write a program that asks the user for the name of a file. The program should display the contents of the file with each line pr
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!