Create a user friendly gui app using the code parameters

Assignment Help Computer Engineering
Reference no: EM132091579

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."); } }

Reference no: EM132091579

Questions Cloud

Calculate the average number of block accesses : Each bucket is one disk block and holds two records. Load these records into the file in the given order, using the hashing function h(K) = K mod 8.
What is elements of a strategic plan : What is elements of a strategic plan and explain why strategic planning is important in global environment?
Primary difficulties associated with a middle-aged person : What do you think are some of the primary difficulties associated with a middle-aged person?
Describe appropriate selectional restrictions on the verbs : Cluster these senses using the definitions of homonymy and polysemy given in chapter 19 (Speech and Language Processing -Jurafsky Martin).
Create a user friendly gui app using the code parameters : Display a message dialog similar to the one shown in listing 2.12, but the message must pertain to VendingChange and not ChangeMaker.
Elevations of the great lakes in vectors : Pascal allows the use of enumerated types as index types.In the above definitions we stored the areas and elevations.
Create a scanner to process the string : You can use a Map where the keys are the Integer length and the values are the Set of the words of that length. This is similar to hw 17.
What is the average case time complexity for linear search : What is the average case time complexity for linear search on a sorted array? Explain (and/or draw a diagram).
Primary objective of statistical process control : Describe the primary objective of statistical process control.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd