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

4. 15 Exact change (College level not sure why it says middle school)

Computers and Technology
1 answer:
sweet [91]3 years ago
6 0

Answer:

def print_change(total_change):#this is also total cents, because integers don't have decimal points, so I can't use dollars as my unit

dollars = int(total_change / 100)

remaining_change = total_change - dollars * 100

quarters = int(remaining_change / 25)

remaining_change -= quarters * 25

dimes = int(remaining_change / 10)

remaining_change -= dimes * 10

nickels = int(remaining_change / 5)

remaining_change -= nickels * 5

pennies = remaining_change

all = {'dollar': dollars, 'quarter': quarters, 'dime': dimes, 'nickel': nickels, 'penny': pennies}

for num in [0, 1, 2, 3, 4]:

coin_type = list(all.keys())[num]

amount = all[coin_type]

if num < 4 and amount > 1 or amount == 0 and num < 4:

coin_type += 's'

elif num == 4 and amount > 1 or amount == 0 and num == 4:

coin_type = 'pennies'

print('\n', amount, coin_type)

while True:

total_change = int(input()) #in cents

print_change(total_change)

Had fun making this one... hope it helps. :)

You might be interested in
CAN SOMEONE PLEASE HELP ME OUT I REALLY NEED THE ANSWER!
Lemur [1.5K]

Answer:

This will work for most languages, but this is mainly for c#. Double check what language your using before putting in this answer.

          Console.WriteLine("What grade are you in?");

           int grade = Convert.ToInt32(Console.ReadLine());

           if (grade == 9)

           {

               Console.WriteLine("Freshman");

           }

           if (grade == 10)

           {

               Console.WriteLine("Sophomore");

           }

           if (grade == 11)

           {

               Console.WriteLine("Junior");

           }

           if (grade == 12)

           {

               Console.WriteLine("Senior");

           }

           if (grade < 8)

           {

               Console.WriteLine("Not in High School");

           }

Explanation:

The first line asks what grade are you in, then when the user types in the grade it saves it in a variable. We then use that variable for the conditionals. The conditional states, whatever grade level your in, it prints your high school year title. If anything is lower than 8, it will print not in high school.

6 0
2 years ago
Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject afte
Marina86 [1]
The correct answer for this question is this one: "She can rename the 2 worksheet by right clicking the sheet tab. After right clicking the mouse, select Rename Sheet and type the preferred name of the sheet."  Hope this helps answer your question and have a nice day ahead.
5 0
3 years ago
Read 2 more answers
Chang is a network engineer. He is revising the company's firewall implementation procedure. As part of this work, he is reviewi
erastovalidia [21]

Answer:

d

Explanation:

3 0
2 years ago
You need to give mary only the rights that she needs. This must be accomplished with the least amount of administrative effort
Arte-miy333 [17]

Answer:

Management is not that easy. And at each level of the work environment, we need it. Suppose Mary works under an editor, and as a writer. Then She will be provided by editor a certain set of rights, that she requires to accomplish her work. And the chief editor who heads the editor, and who might be the administrator has nothing to do with this. And thus this will ensure that the chief editor or the administrator can accomplish other works during this time. And this will certainly save time, of the whole team. And its a rule in management, that only those rights are provided, that are required by the worker, and like in case of Mary.

Explanation:

Please check the answer section.

7 0
2 years ago
Place the steps in order for adding an additional email account in outlook
Zielflug [23.3K]

Answer:

Give Thanks to JessicaRoberts715

1. Click the file tab

2. Click the add account button

3. Type the account information

4. Outlook will auto-configure the account

5. A new account appears in the folder list

6 0
3 years ago
Other questions:
  • Although the battery on your smartphone is fully charged, it drains quickly. In some instances when the phone shows that the bat
    12·1 answer
  • You want to place a video from the internet to your desktop. what process do you use?
    15·1 answer
  • Which best describes the relationship between maximum cost-per-click (max. cpc) bids and ad rank?
    12·1 answer
  • What should you do before cleaning the top of a storage battery and rinsing it with fresh water?
    12·1 answer
  • A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output i
    15·2 answers
  • Give an example of a language L such that |L|=5 and |L^2|=16.
    5·1 answer
  • Consider the problem of solving two 8-puzzles.
    10·1 answer
  • If you are trying to improve your budget and spending, which option would save you the most money?
    13·2 answers
  • Help please! Coding!
    9·1 answer
  • Silas develops this algorithm to compute the calories burned for an activity for a given number of minutes and body weight: If t
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!