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
Grace [21]
2 years ago
12

Write a function number_of_pennies() that returns the total number of pennies given a number of dollars and (optionally) a numbe

r of pennies. Ex: If you have $5.06 then the input is 5 6, and if you have $4.00 then the input is 4. Sample output with inputs: 5 6 4 506 400
Computers and Technology
2 answers:
KonstantinChe [14]2 years ago
7 0

Answer:

Code is given as:-

#number_of_pennies function with one default argument with pennies as 0 when no pennies parameter is given

def number_of_pennies(dollars,pennies = 0):

  pennies = dollars*100 + pennies #one dollar equals 100 pennies so calculate total pennies with this formula

  return pennies #return total pennies

print(number_of_pennies(int(input()),int(input()))) #both Dollars and pennies

print(number_of_pennies(int(input()))) #Dollars only

Explanation:

Here is the sample code and output.

katovenus [111]2 years ago
5 0

Answer:

The function is as follows:

def number_of_pennies(dollars,pennies=0):

   return dollars*100+pennies

   

Explanation:

This defines the function

def number_of_pennies(dollars,pennies=0):

This returns the number of pennies

   return dollars*100+pennies

<em>Note that, if the number of pennies is not passed to the function, the function takes it as 0</em>

You might be interested in
The feature that sets Macs apart from other operating systems is the _____.
pochemuha
What truly sets macs apart is the desktop as they don't have a separate tower system like most other systems do
8 0
2 years ago
Read 2 more answers
Read the poem again and work in pairs or groups to do the following tasks.
kap26 [50]

Answer:

i have no idea what the answer is

Explanation:

8 0
3 years ago
What is the smallest v groove angle that can be welded useing the fca welding process?
vagabundo [1.1K]
The smallest v groove angle that can be welded using the FCA welding process is 20 degrees. Double v joints help for buckling forces especially in welding thicker metals.
3 0
3 years ago
Which are the best examples of how technology can be used in contemporary entrepreneurship?
VARVARA [1.3K]

Answer:A

Explanation:

7 0
3 years ago
Grading on the curve is a method of grading that is based on the belief that letter grades for any given class should be distrib
maks197457 [2]

Answer:

A=input("Enter Number of Marks:")

b=[]

sum=0

i=0

for i in range(0,int(A)):

   b.append(input("Enter Marks"))

   sum+=int(b[i])

percentage1= (sum/int(A))*100

if percentage1>=20:

   print("Grade A")

elif percentage1<=30 & percentage1>=20:

   print("Grade B")

else:

   print("Grade C")

Explanation:

The above program is in Python. And we are using here a dynamic list. And we are storing A marks in it. And then we are finding its average, and finally assigning the Grade as mentioned.

6 0
2 years ago
Other questions:
  • Your boss asks you to work through the weekend to install new software on the applications server that serves up applications to
    15·2 answers
  • Your website is currently at position 5 in organic search. On a monthly basis you currently get on average 5,432 clicks and 32 c
    7·1 answer
  • How can i learn about networks
    15·1 answer
  • How can netiquette help you communicate when texting or instant messaging?
    6·1 answer
  • It is possible to make the document larger for viewing small text.<br><br> True<br> False
    15·2 answers
  • All portions, to include subject, title, paragraphs, sub-paragraphs, graphics, tables, charts, and bullet statements, must be pr
    12·1 answer
  • 01110101<br> +00100100<br> 00010001
    8·1 answer
  • All changes
    15·1 answer
  • How do you convert an algorithm to make it possible for a computer to read
    6·1 answer
  • How do u type please help
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!