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
Gwar [14]
3 years ago
13

in java Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, o

ne coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 Dimes
Computers and Technology
1 answer:
Keith_Richards [23]3 years ago
3 0

Answer:

// Program is written in Java

// Comments are used for explanatory purposes

// Program starts here..

import java.util.*;

public class Money

{

public static void main(String [] args)

{

 Scanner input = new Scanner(System.in);

 // Declare Variables

 int amount, dollar, quarter, dime, nickel, penny;

 // Prompt user for input

 System.out.print("Amount: ");

 amount = input.nextInt();

 // Check if input is less than 1

 if(amount<=0)

  {

   System.out.print("No Change");

  }

 else

  {

   // Convert amount to various coins

   dollar = amount/100;

   amount = amount%100;

   quarter = amount/25;

   amount = amount%25;

   dime = amount/10;

   amount = amount%10;

   nickel = amount/5;

   penny = amount%5;

   // Print results

   if(dollar>=1)

    {

     if(dollar == 1) { System.out.print(dollar+" dollar\n");}

   else { System.out.print(dollar+" dollars\n"); }

}

if(quarter>=1)

{

if(quarter== 1)

{System.out.print(quarter+" quarter\n");}

else{System.out.print(quarter+" quarters\n");}

}

if(dime>=1)

{

if(dime == 1){System.out.print(dime+" dime\n");}

else{System.out.print(dime+" dimes\n");}

}

if(nickel>=1)

{

if(nickel == 1){System.out.print(nickel+" nickel\n");}

else{System.out.print(nickel+" nickels\n");}

}

if(penny>=1)

{

if(penny == 1) {System.out.print(penny+" penny\n");}

else { System.out.print(penny+" pennies\n"); }

}

}

}

}

See attachment for program file

Download java
You might be interested in
What can you do to stop a computer from repeatedly restarting in a continuous loop?
abruzzese [7]
There are ways to break into the boot cycle of every machine, you could use one of them. Hold down modifier key[s] so that it boots differently or you may get a menu to select boot options.

A specific answer is OS/firmware dependent.
4 0
3 years ago
What are the three general methods for delivering content from a server to a client across a network
Tju [1.3M]

Answer:

Answered below.

Explanation:

The three general methods consist of unicasting, broadcasting and multicasting.

Casting implies the transfer of data from one computer (sender) to another (recipient).

Unicasting is the transfer of data from a single sender to a single recipient.

Broadcasting deals with the transfer of data from one sender to many recipients.

Multicasting defines the transfer of data from more than one sender to more than one recipients.

8 0
2 years ago
(Game Design) Which of the following is NOT a name of a popular digital sculpting application?
Savatey [412]

Claymation option A

Because Claymation is not the game design application.it is also called clay animation.

7 0
2 years ago
Based on the unit content and your own ideas, how would you define a video game in your own words? What separates a regular vide
lara31 [8.8K]

Answer:

A video game would be a series of steps to produce or outcome / end in the form of controller a character or the how the game can be played and being able to play it at some level, but a good game would have multiple questions and a hard difficulty maybe even a customizable section for your character or object. In other words a Video game would be a series of steps to produce a outcome from controlling a character and a Good video game would be the same but added a level of difficulty and harder mechanics into the game.

Explanation:

Hope this helped :)

3 0
2 years ago
Definition of Computer forensics?
zysi [14]

Answer:

Computer forensics is the application of investigation and analysis techniques to gather and preserve evidence from a particular computing device in a way that is suitable for presentation in a court of law. The goal of computer forensics is to perform a structured investigation and maintain a documented chain of evidence to find out exactly what happened on a computing device and who was responsible for it.

Explanation:

If this helped you, please consider brainly.

Thank you ,

Miss Hawaii

5 0
2 years ago
Read 2 more answers
Other questions:
  • Why do computers need to periodically check the dns for websites you have already visited? enter your answer here?
    15·1 answer
  • What nondestructive testing method requires little or no part preparation, is used to detect surface or near-surface defects in
    7·1 answer
  • the type() function in python does what when you give it an object. returns the last keystrokes from the user. fill the object w
    9·1 answer
  • Which of the following is NOT necessary for organizing data to make it easier to sort?
    6·1 answer
  • Importance of computer​
    15·1 answer
  • You are reviewing the output of the show interfaces command for the Gi0/1 interface on a switch. You notice a significant number
    12·1 answer
  • What are the features of a computer speaker​
    10·1 answer
  • When you check your hard drive to see how much space is available, you are checking your
    15·1 answer
  • Can anyone tell me about Microsoft some important features for partical
    11·1 answer
  • Difine the term pigment​
    14·3 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!