Part Two: Download VendingChange.java (above). Run itand become familiar with the output. Essentially, you need tocreate a user friendly GUI app using the code parameters ofVendingChange. Turn VendingChange.java into a GUI app.
1) Your program must display the inputdialog.
2) You must check that the data entered by the user follows therequired input. If not, your program must display an error dialogand exit.
3) If the input is valid, then your program must display amessage dialog similar to the one shown in listing 2.12, but themessage must pertain to VendingChange and not ChangeMaker. Yourmessage dialog must show the number of pennies, nickels, dimes andquarters.
4) Your program must exit when the user closes the output messagedialog.
5) Comment and document your program.
Complete the programming problems such that they produceoutput that looks similar to that shown in the text or upcomingclass presentations (in-class and Announcements). Tips and formulas(if any) will be discussed in class. Additional details will beprovided in class and Announcements.
add comments to code please.
import java.util.Scanner;public class VendingChange{ public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); System.out.println(\"Enter price of item\"); System.out.println (\"(from 25 cents to a dollar, in 5-cent increments)\"); int originalAmount = keyboard.nextInt(); int change = 100 - originalAmount; int quarters = change/25; change = change%25;// remaining change after deducting quarters int dimes = change/10; change = change%10;// remaining change after deducting dimes, too int nickels = change/5; change = change%5; int pennies = change; //The grammar will be incorrect if any of the values are 1 //because the required program statements to handle that //situation have not been covered, yet. System.out.println (\"You bought an item for \" + originalAmount + \" and gave me a dollar,\"); System.out.println(\"so your change is\"); System.out.println(quarters + \" quarters,\"); System.out.println(dimes + \" dimes, and\"); System.out.println(nickels + \" nickel.\"); }}