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
Thepotemich [5.8K]
3 years ago
7

6.12.1: Return number of pennies in total. Write a function NumberOfPennies() that returns the total number of pennies given a n

umber of dollars and (optionally) a number of pennies. Ex: 5 dollars and 6 pennies returns 506.
Computers and Technology
1 answer:
Anit [1.1K]3 years ago
3 0

Answer:

public class Pennies

{

public static void main(String[] args) {

 System.out.println("Total pennies: " + NumberOfPennies(5, 6));

               System.out.println("Total pennies: " + NumberOfPennies(5));

}

public static int NumberOfPennies(int amount, int pennies) {

    int total = (amount * 100) + pennies;

   

    return total;

}

public static int NumberOfPennies(int amount) {

    NumberOfPennies(amount, 0);

    int total = amount * 100;

   

    return total;

}

}

Explanation:

- Create a function called NumberOfPennies that takes two parameters, amount and pennies

- In order to calculate the number of pennies, multiply the given amount by 100 and add the pennies. Set this result to the total and return the total.

- Since pennies parameter should be optional, overload the function NumberOfPennies so that it can take one parameter, amount. When it takes one parameter, the value of the pennies set to 0.

Inside the main, call the function with two possible scenarios

You might be interested in
What character separates the file extension and the filename?
PtichkaEL [24]
A period, Filenamehere.png or .pdf or any other file extension
5 0
3 years ago
Read 2 more answers
Analyze the error in the html code :<br><br> HTML
Andrei [34K]

Answer:

The World Wide Web Consortium provide a simple online tool (https://validator.w3.org/) that automatically check your HTML code and point out any problems/errors your code might have, such as missing closing tags or missing quotes around attributes.

Explanation:

your question is not clear

hope it helps

6 0
3 years ago
How should I do it Please code for Java
andrew-mc [135]

Answer:

class Main {  

 public static void printPattern( int count, int... arr) {

     for (int i : arr) {

       for(int j=0; j<count; j++)

           System.out.printf("%d ", i);

       System.out.println();

     }

     System.out.println("------------------");

 }

 public static void main(String args[]) {

   printPattern(4, 1,2,4);

   printPattern(4, 2,3,4);

   printPattern(5, 5,4,3);

 }

}

Explanation:

Above is a compact implementation.

3 0
3 years ago
You’ve been tossed into an insane asylum. What do you tell the people there to prove to them that you don’t belong inside?
mars1129 [50]
Was this a question on an assignment or are you in an asylum right now
3 0
3 years ago
Read 2 more answers
How does a cloud-first strategy differ from other approaches to cloud?
Irina18 [472]

Cloud-first strategy differ from other approaches as It keeps all the services performed by legacy systems while moving to the Cloud in a staggered approach.

<h3>What is a cloud first strategy?</h3>

The change of cloud computing has brought about  “cloud-first” strategy.

This  is known to be a way to computing that tells that a firm should look first to cloud solutions when creating new processes or taking in old processes before taking in non-cloud-based solutions.

Note that Cloud-first strategy differ from other approaches as It keeps all the services performed by legacy systems while moving to the Cloud in a staggered approach.

See options below

it enables an organization to completely move to the cloud without infrastructure or support requirement

it keeps all the services performed by legacy systems while moving to the cloud in a staggered approach.

it partners technology with multiple other disciplines for comprehensive business transformation.

it uses artificial intelligence to automate all business processes and completely eliminate human error.

Learn more about cloud from

brainly.com/question/19057393

#SPJ1

6 0
2 years ago
Other questions:
  • In a mission critical environment, performing maintenance operations on a host FIRST requires which of the following?
    6·1 answer
  • Put the following five steps in the order in which you would perform them to use the Paste Special function: ____. 1. Select and
    5·1 answer
  • Corey is an architect. What software does he most likely use to design houses? graphic software scheduling software CAD software
    10·2 answers
  • PLEASE DON'T DELETE THIS QUESTION!!!!
    15·2 answers
  • Describe how data center storage applications drive the development of SAN technology.
    8·1 answer
  • What does this result prove about the computer’s network connectivity?
    12·1 answer
  • Where do you define parameter variables?
    14·1 answer
  • In the last two decades, how have cameras evolved?
    12·2 answers
  • Assume that students in a course are required to produce a written report on an ICT-related
    14·1 answer
  • Give a common business example that mimics the differences between a shared
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!