How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask LogicPro Your Own Question
LogicPro
LogicPro, Computer Software Engineer
Category: Programming
Satisfied Customers: 12735
Experience:  Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.
29751445
Type Your Programming Question Here...
LogicPro is online now
A new question is answered every 9 seconds

Write a program that asks the user for an amount of money

Customer Question

Write a program that asks the user for an amount of money (entered in cents) and then tells the user how to make change for that amount using only quarters, dimes, nickels, and pennies. Use the strategy used in lesson 2.2 (e.g., you must use the modulus operator), and format your output exactly as in this sample screen output. Note that the pennies must be output first.enter number of cents: 119
pennies: 4
nickels: 1
dimes: 1
quarters: 4
JA: How long has this been going on?
Customer: import java.util.Scanner; //program uses class Scannerpublic class A1_1
{
public static void main( String[] args ) {
Scanner sc = new Scanner(System.in);
double cents = sc.nextInt();
int amountCents;
int pennies;
int nickels;
int dimes;
int quarters;
int amountLeft;
"Enter amount of cents:";
amountCents;
quarters = amountCents / 25;
amountLeft =amountCents % 25;
dimes = amountLeft / 10;
amountLeft = amountCents % 10
nickels = ( amountLeft % 10) /5;
pennies = nickels /1;
System.out.println(totalQuarter);
System.out.println(totalDime);
System.out.println(totalNickel);
System.out.println(totalPennies);
}}
JA: What troubleshooting have you tried?
Customer: import java.util.Scanner; //program uses class Scannerpublic class A1_1
{
public static void main( String[] args ) {
Scanner sc = new Scanner(System.in);
double cents = sc.nextInt();
int amountCents;
int pennies;
int nickels;
int dimes;
int quarters;
int amountLeft;
"Enter amount of cents:";
amountCents;
quarters = amountCents / 25;
amountLeft =amountCents % 25;
dimes = amountLeft / 10;
amountLeft = amountCents % 10
nickels = ( amountLeft % 10) /5;
pennies = nickels /1;
System.out.println(totalQuarter);
System.out.println(totalDime);
System.out.println(totalNickel);
System.out.println(totalPennies);
}}
JA: The programmer can solve this for you. Anything else you want him to know before I connect you two?
Customer: no thanks~
Submitted: 7 months ago.
Category: Programming
Expert:  LogicPro replied 7 months ago.

Hi

Welcome here. My name is ***** ***** I will help you.

What is the deadline?

Customer: replied 7 months ago.
tonight
Expert:  LogicPro replied 7 months ago.

Looking at the efforts, I am sending you revised offer. Let me know once you accept it.

Customer: replied 7 months ago.
sorry. I wanna get a refine.
Expert:  LogicPro replied 7 months ago.

Do you still need the answer?

Customer: replied 7 months ago.
I wanna answer, but I thought it was only $5
Customer: replied 7 months ago.
if it's that expensive, I wanna my money back. sorry..
Expert:  LogicPro replied 7 months ago.

The prices are as per the efforts required.

You have posted the question for 50.

Customer: replied 7 months ago.
I wanna refund.
Expert:  LogicPro replied 7 months ago.

ok

Sending request for refund.

Related Programming Questions