Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Download VendingChange.java (above). Run it and become familiar with the output. Essentially, you need to create a user friendly GUI app using the code parameters of VendingChange.

Turn VendingChange.java into a GUI app.

1) Your program must display the input dialog.

2) You must check that the data entered by the user follows the required input. If not, your program must display an error dialog and exit.

3) If the input is valid, then your program must display a message dialog similar to the one shown in listing 2.12, but the message must pertain to VendingChange and not ChangeMaker. Your message dialog must show the number of pennies, nickels, dimes and quarters.

4) Your program must exit when the user closes the output message dialog.

5) Comment and document your program.

Complete the programming problems such that they produce output that looks similar to that shown in the text or upcoming class presentations (in-class and Announcements). Tips and formulas (if any) will be discussed in class. Additional details will be provided in class and Announcements.

add comments to code please.

instruction number 2 is really important 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."); } }

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93079050

Have any Question?


Related Questions in Computer Engineering

Rocket class keyboard event handlingintroductionfor this

Rocket Class: Keyboard Event Handling Introduction For this program, you will implement an interface that will allow you to move around a rocket of your own design. You will need to implement your own classes for the roc ...

A bit-comparator is a combinational circuit with 2 inputs a

A Bit-Comparator is a combinational circuit with 2 inputs, A and B, and 3 outputs. L, E and G. Output L is 1 if A Output E is 1 if A = B, otherwise E is 0. Output G is 1 if A > B, otherwise G is 0. Show how the 2x4 decod ...

Suppose a finite deck of numeric cards 1 2 3 have been

Suppose a finite deck of numeric cards 1, 2, 3, ... have been shuffled randomly. Repeat the following step: If the top card is numbered 1, the game terminates. But if it is any number n > 1, then reverse the ordering of ...

One of the basic motivations behind the minimum spanning

One of the basic motivations behind the Minimum Spanning Tree Problem is the goal of designing a spanning network for a set of nodes with minimum  total  cost. Here we explore another type of objective: designing a spann ...

Question using a web browserand a search engine the terms

Question: Using a web browserand a search engine the terms "citibank backup tapes lost." You will find many results. Select one article and identify what that article considers a ,short coming in citibank's planning. Wha ...

You are required but not limited to turn in the following

You are required, but not limited, to turn in the following source file: Requirements to get full credits in Documentation The assignment number, your name, StudentID, Lecture number(time), and a class description need t ...

Question suppose you are the co-author of an academic paper

Question : Suppose you are the co-author of an academic paper that is being prepared for publication. The original research idea is yours, but you let your co-authors handle the data collection and actual writing of the ...

Question suppose you are tasked with designing the security

Question : Suppose you are tasked with designing the security system for a new web browser that supports rendering web pages with embedded web page scripts. What checks would you need to implement to ensure that executin ...

Subject digital securitycompared to android what are the

Subject: Digital security Compared to Android, what are the main differences of security provided by IOS? Your answer is expected to at least cover encryption ciphers, protocols and technologies used in data and network ...

Design layout reference mailings review view consolas 105 a

Design Layout Reference Mailings Review View Consolas 10.5 A. A Styles styles H- 1. Report the total payments by date when the total payments are greater than $20,000. 2. List the amount paid by each customer who has pai ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As