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]
3 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]3 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]3 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
What does coding mean​
NeTakaya
The process or activity of writing computer programs.
3 0
3 years ago
Read 2 more answers
When data are entered into a form and saved, they are placed in the underlying database as knowledge?
luda_lava [24]
The answer would be and is true.
7 0
3 years ago
Consider two different implementations of the same instruction set architecture (ISA). The instructions can be divided into four
PSYCHO15rus [73]

Answer: Find answers in the attachments

Explanation:

3 0
3 years ago
11.How would you characterize the relative range of paths forecasted by the various computer models on August 25
larisa86 [58]

Answer:

Following are the solution to this question:

Explanation:

There is some difference between both the path expected by different computer simulations on 25 August. There is also some variance between 50 km to 500 km in the predicted route but the path is also unique in each model evaluation. It might be because any and every possible situation is repeated by the computer program. Many simulations will focus mostly on variations of strain, one might focus on the temperature variation, or one might concentrate on certain variables. But each model suggests all and every parameter which is inserted during a very photographer's encoding. There are therefore several possibilities of variability in forecasting the Hurricane's course. Here and some forecasts have shown that hurricanes would pass through Florida fully, and also some models have shown that hurricanes would pass thru the Gulf Coast, accompanied by the areas of Mississippi or Louisiana. This is the real difference in the direction of these models.

3 0
3 years ago
Which type of database program is Microsoft Access 2016?
nadya68 [22]

Answer:

O relational

Explanation:

If I'm wrong I'm so so sorry! But form my research it keeps saying its relational.

If I'm right please give me brainliest I really need it to level up so please help me!

If you don't know how to give brainliest there should be a crown underneath my answer you just have to click it.

Thank you and have a wonderful night,morning,afternoon/day! :D

6 0
3 years ago
Read 2 more answers
Other questions:
  • Assure that major, minor, sub1 and sub2 each contain four digit numbersIf less than four digits are entered in major OR minor OR
    5·1 answer
  • You want to place a video from the internet to your desktop. what process do you use?
    15·1 answer
  • EASY AND I GIVE BRAINLIEST!!! What is a good jeopardy question about operating systems?
    6·1 answer
  • Why would you set up a workbook to be shared if you are the only one using the workbook?
    7·1 answer
  • 18) choose which article title would most likely be described by the database subject headings victims of famine, ireland, histo
    14·1 answer
  • A keyboard and touch screen are the most common of ________ devices. select one:
    11·1 answer
  • Radio waves can be used to transmit energy. What is an advantage of this method in computer technology
    7·2 answers
  • Users can customize their Windows device by going to the Control Panel under __________.
    15·2 answers
  • What best describes the ability to increase the access to server resources and provide fail-safe services by linking two or more
    13·1 answer
  • Alfred works in the human resources department, and he uses a management information system to find applicants' résumés on the w
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!