this is my problem!
I have to create a console application that asks for numbers of quarters, dimes, nickesl,and pennies.
I have to use the Scanner class that read in the integer values for each coin.
Calculate total values in cents.
Calculate number of dollars and remaining cents.
import java.util.Scanner;
public class MoneyScanner1 {
public static void main( String [] args){
int quarter =((100/100)*25);
int dimes = ((100/100)*10);
int nickels = ((100/100)*5);
int pennies = ((100/100)*1);
int dollars = (quarter+dimes+nickels+pennies);
int cent = (100/1);
Scanner scan = new Scanner (System.in);
System.out.print("How many quarters?\t ");
quarter = scan.nextInt();
System.out.print("\nHow many dimes? ");
dimes = scan.nextInt();
System.out.print("\nHow many nickels? ");
nickels = scan.nextInt();
System.out.print("\nHow many pennies? ");
pennies = scan.nextInt();
System.out.print("Your change equals" + dollars + "dolars" + "and" + cent + "cents");
}
}
the output should look like this:Sample output
/* ===========================================
OUTPUT:
How many quarters? 4
How many dimes? 5
How many nickels? 6
How many pennies? 7
Your change equals 1 dollars and 87 cents
=========================================== */