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]
2 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]2 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
Can someone help me?
stich3 [128]

Answer:

2nd one

Explanation:

7 0
3 years ago
Read 2 more answers
Write a program whose input is two integers. Output the first integer and subsequent increments of 10 as long as the value is le
Lubov Fominskaja [6]

Answer:

import java.util.Scanner;

public class TestClock {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter two integer numbers");

       int num1 = in.nextInt();

       int num2 = in.nextInt();

       int newSum=num1+10;

       System.out.println("The first number is "+num1);

       do{

          System.out.println(newSum);

          newSum +=10;

       }while (newSum <=num2);

   }

}

Explanation:

Using Java Programming language

  1. Prompt user for the two inputs and save them as num1 and num2(Using the scanner class)
  2. Create a new Variable newSum = num1+10
  3. Create a do...while loop to continually print the value of newSum, and increment it by 10 while it is less or equal to num2
3 0
3 years ago
Serena is adding headers and footers in the Slide Master view using the Header and Footer dialog box What is not
sergiy2304 [10]

Answer:

NUMBER 3

Explanation:

5 0
3 years ago
Read 2 more answers
Do all accounts serve the same function? Why or why not?
lora16 [44]

The correct answer is D. No, accounts serve the purpose that their owners choose.

There are different types of bank accounts which are for saving, fixed deposit account, current account, and recurring account.

Basic banking provides amount of customers with a banking comfort.

They also provide cistomer and secure friendly environment.

3 0
3 years ago
Read 2 more answers
Mohammad plans to visit a cave over the weekend with his friends. He wants to take photos inside of the cave. What piece of equi
Alborosie
A camera strap
Its the only one that makes sense
7 0
2 years ago
Read 2 more answers
Other questions:
  • Suppose two computers (A &amp; B) are directly connected through Ethernet cable. A is sending data to B, Sketch the waveform pro
    9·1 answer
  • When possible, you should avoid using _________ variables in a program?
    11·1 answer
  • An email address contains the @ character. Write a program that takes asks for an email address input from the user and determin
    5·1 answer
  • Many organizations find themselves in the position of being data rich and information poor. Even in today's electronic world, ma
    13·1 answer
  • Robert's employer has agreed to pay half the tuition for Robert to complete his college degree. This benefit is known as what?
    7·2 answers
  • Which of the following are causes of a run-time error. Choose all that apply.
    13·1 answer
  • Make this be a 7th grade argument over a boy
    5·2 answers
  • Consider a Huffman’s Algorithm that uses a variable-length encoding scheme to compress the original text: BIRTHDAY to determine
    7·1 answer
  • 8.1.4: Ghost Invasion!
    10·1 answer
  • 40 points for this question
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!