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

You will need to complete the functions these functions: a. get_total This function takes in pennies, nickels, dimes, and quarte

rs. it returns the value of the money sent in via parameters in dollars. b. get_dollars This function takes in pennies, nickels, dimes, and quarters. it returns the dollar portion of the money sent in via parameters. c. get_left_over_cents This function takes in pennies, nickels, dimes, and quarters. it returns the cents portion of the money sent in via parameters.
Computers and Technology
1 answer:
tankabanditka [31]3 years ago
6 0

Answer:

penny = int(input("Enter number of pennies: "))

nickel = int(input("Enter number of nickel: "))

dime = int(input("Enter number of dime: "))

quarter = int(input("Enter number of quarter: "))

def get_total(penny, nickel, dime, quarter):

   total = ((1 * penny) + (5 * nickel) + (10 * dime) + (25 * quarter))/ 100

   print (f"The total amount is {total}")

   

def get_dollars(penny, nickel, dime, quarter):

   dollar = ((1 * penny) + (5 * nickel) + (10 * dime) + (25 * quarter))// 100

   print (f"The dollar part is ${dollar}")

   

def get_left_over_cent(penny, nickel, dime, quarter):

   cent = ((1 * penny) + (5 * nickel) + (10 * dime) + (25 * quarter)) % 100

   print (f"The left over cent is {cent} cents")

 

   

get_total(penny, nickel, dime, quarter)

get_dollars(penny, nickel, dime, quarter)

get_left_over_cent(penny, nickel, dime, quarter)

Explanation:

In the United States, these coins have following values:

Quarter= 25 cents

Dime= 10 cents

Nickel= 5 cents

Penny= 1 cent

The first line collect an input from the user, convert to integer and assign to penny.

The second line collect an input from the user, convert to integer and assign to nickel.

The third line collect an input from the user, convert to integer and assign to dime.

The fourth line collect an input from the user, convert to integer and assign to quarter.

Based on the above definition of penny, nickel, dime and quarter; we defined the various function.

First the get_total function was defined and the total amount was calculated and assigned to total, then the total was output to the user.

Then, the get_dollars function was defined and the dollar part was calculated through dividing the total by 100. (100 cents = $1). The dollar was also output to the user.

Then, the get_left_over_cents function was defined and the cent was calculated by finding the remainder when the total is divided by 100 (cent = total % 100). The symbol "%" represent modulo and is used to find remainder of a division operation.

You might be interested in
Melissa is the network administrator for a small publishing company. as network administrator, she is in charge of maintaining t
Arte-miy333 [17]
The answer is an Intruder Prevention System (IPS). An Intrusion Detection System (IDS) will detect an attack but will not block it.
3 0
3 years ago
What function returns a line and moves the file pointer to the next line?
Aneli [31]
The goto command

for example


:start

title ""graphing calculator""

goto start
5 0
3 years ago
1. In Microsoft Word you can access the _______ command from the "Mini toolbar." A. underline B. insert citation C. save as D. w
SSSSS [86.1K]
It should be B i pretty sure

3 0
3 years ago
Read 2 more answers
What is the term for movement in particular direction
gladu [14]
The term would be: Velocity 
Velocity is the speed of an object in a particular direction. 
4 0
3 years ago
Read 2 more answers
What is a tag in an HTML document?
Llana [10]

Answer: HTML is considered as the Lingua franca of the net that is a simple mark up language used for the purpose of web publishing for creating text and images. This can be viewed by any of the member and can be used within any browser. There is no need of special software for creating HTML pages and moreover the learning of HTML is pretty easy.

Explanation: If you need more help go follow me at dr.darrien

- thank you

3 0
4 years ago
Read 2 more answers
Other questions:
  • The operating system is not directly involved in one of these tasks.Immersive Reader
    12·1 answer
  • 6. When should you return to the right lane after passing another car on the left?
    14·2 answers
  • Data bars describe a graphic element that
    7·1 answer
  • One of the disadvantages of Audacity is that it has limited technical support since it is a free program.     true or false
    11·2 answers
  • What are the possible sources of the information that defines the functional dependencies that hold among the attributes of a re
    15·1 answer
  • Write a program that accepts 5 number and arrange them in ascending order​
    7·1 answer
  • What happens when a filter is applied to a database?
    13·1 answer
  • Problem 4 (3 pts): Let n be a positive integer. Show that among any group of n 1 (not necessarily consecutive) positive integers
    15·1 answer
  • Daniel would like to send a letter to more than one hundred people. He should type each letter separately.
    12·1 answer
  • It is not important to type '=' before a formula or a function
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!