Question: Java- How do i fix these errors Public static void main (String[] args) Scanner userlnput = new Scanner(System.in); int amount = 0; int $20 =
Java- How do i fix these errors
![Java- How do i fix these errors Public static void main (String[]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f460324802a_44166f46031bf52f.jpg)
Public static void main (String[] args) Scanner userlnput = new Scanner(System.in); int amount = 0; int $20 = 0; int $10 = 0; int $5 = 0; int $1 = 0; System.out.print("Enter the amount: "); amount = userInput.nextInt(); if (amount > 500) {System.out.println("Limit of $500 exceeded!");} else {System.out.println("Bills by denomination: "); $20 = amount/20; int rest_amount = amount % 20; $10 = rest_amount/10; rest_amount = rest_amount % 10; $5 = rest_amount/5; rest_amount = rest_amount % 5; $1 = rest_amount/1; System.out.printin("\t$20: " + $20); System.out.printin("\t$10: " + $10); System.out.printin("\t$5: " + $5); System.out.printin("\t$l: " + $1); System.out.println("$" + amount +"=("+ $20 + " * $20) + (" + $10 + " * $10) + (" + $5 + " * $5) + (" + $1 + " * $1)");}}}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
