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
Allushta [10]
3 years ago
7

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

ber of pennies.
Computers and Technology
1 answer:
Gemiola [76]3 years ago
4 0

In python 3.8:

def number_of_pennies(dollars, pennies = 0):

   return (dollars * 100) + pennies

print(number_of_pennies(1))

def number_of_pennies(dollars, pennies = 0):  This defines are function and the pennies = 0 sets the default value of pennies equal to 0.

return (dollars * 100) + pennies. This returns the amount of pennies in any amount of dollars and pennies given by the user.

print(number_of_pennies(1)) This prints the return value of our function which is the number of pennies. We don't have to give a number for the amount of pennies because the default value is 0, but we still have to give a value to the dollars.

I hope this helps!

You might be interested in
What is data and instructions entered into the memory of a device
lyudmila [28]

A POINTING DEVICE IS AN INPUT DEVICE THAT ALLOWS A USER TO CONTROL A POINTER ON THE SCREEN. ... A KEYBOARD IS AN INPUT DEVICE THAT CONTAINS KEYS USER TO ENTER DATA AND INSTRUCTIONS INTO A COMPUTER.                                                                            

SORRY FOR CAPS MY CAPS KEY GOT STUCK

3 0
4 years ago
True/false: the cause of failure in a computer program is often due to more than one factor
kozerog [31]
True of course the computer is a big electronic
7 0
3 years ago
Read 2 more answers
Define a function UpdateTimeWindow() with parameters timeStart, timeEnd, and offsetAmount. Each parameter is of type int. The fu
NARA [144]

Answer:

Here is a UpdateTimeWindow() method with parameters timeStart, timeEnd, and offsetAmount

// the timeEnd and timeStart variables are passed by pointer

void UpdateTimeWindow(int* timeStart, int* timeEnd, int offsetAmount){

// this can also be written as  *timeStart = *timeStart + offsetAmount;

*timeStart += offsetAmount;  //adds value of offsetAmount to that of //timeStart

// this can also be written as  *timeEnd = *timeEnd + offsetAmount;

  *timeEnd += offsetAmount;  } //adds value of offsetAmount to that of //timeEnd

Explanation:

The function has three int parameters timeStart, timeEnd, and offsetAmount.

First two parameters timeStart and End are passed by pointer. You can see the asterisk sign with them. Then in the body of the function there are two statements *timeStart += offsetAmount; and *End+= offsetAmount; in these statements the offsetAmount is added to the each of the two parameters timeStart and timeEnd.

8 0
3 years ago
Which type of classroom enables students to attend lectures without being physically present with the teacher?
Kisachek [45]
An online class? I think lol
5 0
3 years ago
When reviewing a news article online that includes some questionable statistics what stategies can you apply to ensure that the
Artemon [7]

Answer:

The answer is below

Explanation:

To verify the accuracy of a news article, here are some of the strategies to employ.

1. Check the source of the news article

2. Check whether the write er or author has credible reputation

3. Examine if the writer or author has related background to the subject of study

6. Compare the news information with the ones know.

7 0
3 years ago
Other questions:
  • From what tab can you format individual cell data like any other text?
    10·1 answer
  • Hat is the simplest way to permanently get rid of an unwanted file
    12·1 answer
  • Question 2 Unsaved Which of these is NOT an example of an emerging technology? Question 2 options: Sixth Sense Close Range Drone
    6·1 answer
  • What is the output of the following code segment? int n = 0; for (int k = 0; k< 2; k++) {n=n +2;} cout << n; oo 0 1 O O
    8·1 answer
  • Which website can help you find antivirus software ?
    10·1 answer
  • Types of antivirus explain them
    9·1 answer
  • What will be a fundamental aspect of future games?
    10·2 answers
  • Specialized high-capacity second storage devices designed to meet organizational demands
    12·2 answers
  • Suppose you want to boot a VM from its virtual DVD drive, but it boots to the VM’s hard drive. Which of the following could be t
    12·1 answer
  • Select the correct answer.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!