So Im trying to make a Coinstar Simulation and pretty much what it does is it adds up all the money and gives me a total. Im a computer science student learning java for the first time so I'm a bit confused as to what code i should put next to get the total. Also if i had to add a percent of tax in there...how would i do that? thanks a lot !
public static void main(String[] args) {
// TODO code application logic here
double dollars, halfdollars, quarters, dimes, nickels, pennies, amount;
Scanner coinstar = new Scanner (System.in);
System.out.println("Enter Number Of");
System.out.print("Dollars:");
dollars = coinstar.nextDouble();
System.out.print("Half Dollars:");
halfdollars = coinstar.nextDouble();
System.out.print("Quarters:");
quarters = coinstar.nextDouble();
System.out.print("Dimes:");
dimes = coinstar.nextDouble();
System.out.print("Nickels:");
nickels = coinstar.nextDouble();
System.out.print("Pennies:");
pennies = coinstar.nextDouble();
dollars= 1.00;
halfdollars = 0.50;
quarters = 0.25;
dimes = 0.10;
nickels = 0.05;
pennies = 0.01;
System.out.println("Cash Value = $" );
}
}