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
In c++
Musya8 [376]

Answer:

C

Explanation:

You should make a string where they enter the vaulue and you calculate the interest by multipliying then the code should look like this input balance

balance=0 then they would select the amount and 0+entered amount  times interest im 12 btw so

7 0
4 years ago
Which of the following would most likely be the target audience for a product
inna [77]

Answer:

B

Explanation:

They are saturday morning cartoons. Saturday morning cartoons are meant towards an audience of young children.

3 0
3 years ago
Read 2 more answers
Pam wants to include a video from a website in an upcoming presentation. However, she knows she will not have access to an inter
Dima020 [189]
I think Download and save is the answer
3 0
3 years ago
Read 2 more answers
________ is used to enter the results of a CBC into the computer system.pharmacy system.laboratory system.order entry/results re
podryga [215]

Answer:

laboratory system.

Explanation:

4 0
3 years ago
Counting calculus students. About A university offers 3 calculus classes: Math 2A, 2B and 2C. In both parts, you are given data
OleMash [197]

Answer:

Part (a) n(A∩B∩C) = 4

Part (b) n(A∪B∪C) = 54

Explanation:

n(A) = no. of students who took Math 2A

n(B) = no. of students who took Math 2B

n(C) = no. of students who took Math 2C

n(A∩B) = no. of students who took both Math 2A and 2B

n(A∩C) = no. of students who took both Math 2A and 2C

n(B∩C) = no. of students who took both Math 2B and 2C

n(A∩B∩C) = no. of students who took all three Math 2A, 2B and 2C

n(A∪B∪C) = no. of total students in a group

∩ represents Intersection and ∪ represents Union

Part (a)

n(A∪B∪C) = n(A) + n(B) + n(C) - n(A∩B) - n(A∩C) - n(B∩C) + n(A∩B∩C)  

Where n(A∩B∩C) represents the number of students who took all three classes and n(A∪B∪C) represents the total number of students in group A

157 = 51 + 80 + 70 - 15 - 20 - 13 + n(A∩B∩C)

Re-arranging the equation to solve for n(A∩B∩C) since we want to find out those students who took all three classes

n(A∩B∩C) = 157 - 51 - 80 - 70 + 15 + 20 + 13

n(A∩B∩C) = 4

So there are 4 students in group A who took all three classes

Part (b)

n(A∪B∪C) = n(A) + n(B) + n(C) - n(A∩B) - n(A∩C) - n(B∩C) + n(A∩B∩C)

This time we are given n(A∩B∩C) students who took all three classes and want to find n(A∪B∪C) that is total number of students

n(A∪B∪C) = 28 + 28 + 25 - 11 - 9 - 10 + 3

n(A∪B∪C) = 54

So there are total 54 students in group B

8 0
3 years ago
Other questions:
  • We may think of relationships in the E/R model as having keys, just as entity sets do. Let R be a relationship among the entity
    14·1 answer
  • What term refers to a piece of software that interfaces with the hardware on your computer?
    10·2 answers
  • An algorithmic function that takes an input message of arbitrary length and returns an output of fixed-length is called a(n) ___
    10·1 answer
  • What is the focus of developers interested in the Internet of things?
    11·2 answers
  • Hi i need to know how much watt hours divided by month total
    14·1 answer
  • Which shape denotes a process to be carried out in a flowchart?
    7·2 answers
  • Use the Law of Sines to solve the triangle. Round your answers to two decimal places.
    6·1 answer
  • 1. What does a network allow computers to share?
    13·1 answer
  • What will be the code in CSS, to set
    8·1 answer
  • Assume your sketch has a variable named silo, which stores an object that is defined by a class you have created. The name of th
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!