Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Jake Robbins
- import java.util.Scanner;
- public class ch2ex4
- {
- public static void main ( String[ ] args )
- {
- Scanner scan = new Scanner( System.in );
- int x, y, dollars, cents;
- y = 100;
- System.out.println("Input your change:");
- x = scan.nextInt();
- cents = x % y;
- dollars = x / y;
- System.out.println("That is " + dollars + " " + "dollars and" + " " + cents + " " + "cents");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement