Write a java applet using swing components, JAVA Programming

Assignment Help:

The project is optional. It is worth at least 7 bonus points beyond overall 100 points of this course. The grading will be on a pass/fail basis.

Write a Java application (not applet) to simulate a Vending Machine. This is a GUI program. A user can buy a bottle of water ($1.00), or a can of Coke ($1.25), or a bottle of Sprite ($1.50), or a bottle of root beer ($2.25), or a chocolate bar ($2.50). To make program simple, we assume that a user can buy only one item each time. Additionally, we assume there are only ten units for each item in the machine.

At the top of window, your program should have an interface for users to select item. It could be the selection panel of a real vending machine, which includes keys of A, B, 0, 1, 2, ..., and 9. Or you can use an option list, or a selection menu.

Next, the window should have a portion for the user to insert money. A user can insert a nickel, a dime, a quarter, or a dollar bill by clicking (or pushing the mnemonic key) a corresponding button. You program should record the total inserted amount. Credit card is not allowed.

Then, there should be a purchase button and an exit button. After pushing purchase button, your program will compare the money inserted to the price of selected item. If the former is greater or equal to the latter, then the program should print "xxx item has been dropped to the bottom. You change is xxx.xx." If not, a message will be displayed to tell the user insert more. If one item is sold out, a prompt for changing item to buy should be displayed.

Use bonus + Your Last Name + First Letter of Your First Name as the project name. Note that no space or special character is allowed in the name and all letters should be lower case. Zip the entire project directory into a .zip file and upload it to the Bonus folder in the Blackboard Assignments. You must include all subfolders and reserve the directory structure.

 Note:

  • Use hw4 + Your Last Name + First Letter of Your First Name as the project name. Note that no space or special character is allowed in the name and all letters should be lower case. For instance, for me, the name should be hw4dingw.
  • Zip the entire project directory into a .zip file for each project. For each project, you must include all subfolders and reserve the directory structure. Then upload both zip files to Assignments → Homework4 in the Blackboard. You MUST submit through Blackboard, unless in case it is too late. Otherwise 10 points will be deducted.
  • At the very beginning of your source file of the test class, in the comment, you should put your full name, the course number and name, the number of homework (here it is Homework4), the problem number, and the date of last successful debugging. Two points will be cut for each project without this information.
  • You MUST use Eclipse as IDE.
  • Each program MUST compile and run without error.

 

Write a Java applet using swing components to calculate and reserve a room at My Favorite Hotel. The applet should contain the following

  • Display today's (not today but the day the Java program is called)
  • Day of arrival è textfield (MMDDYYYY) edit for reasonable validity
  • Number of nights è textfield edit for validity (should be 1 through 30)
  • Drop down box for the number of people (1 through 4)
  • Drop box for Regular, Deluxe, or Suite
  • Radio button for 1 king size bed or 2 queen size beds
  • Radio button for Smoking or Non-Smoking or Any available
  • Button to check availability and calculate charge (you don't have to check availability unless you want to research interfacing to a Access or Excel)
  • Button to reserve - Will come back with a confirmation number and confirmation of inputted information (You don't have to reserve however unless you want to research)
  • The charges for the rooms are $110 for regular, $120 for deluxe, and $150 for suite. $15 extra per person will be charged for more then 2 people, and there is a 13.5% tax.
  • All editing should respond with the proper error.

 


Related Discussions:- Write a java applet using swing components

Explain about core java, Java is increasingly used for middleware applicati...

Java is increasingly used for middleware applications to communicate among Server and clients. Java has features like multithreading, portability and networking capabilities. Chang

Write complete application to play game tic-tac-toe, (Tic-Tac-Toe)  Create...

(Tic-Tac-Toe)  Create class TicTacToe that will enable you to write a complete application to play the game of Tic-Tac-Toe. The class contains a private 3-by-3 rectangular array o

Develop a school java project, Develop a School java project Project Des...

Develop a School java project Project Description: Programming java, threads. Not so hard but requires knowledgeSkills required: Java

Overloading method, QUESTION 3: Overloaded methods Write the overloaded me...

QUESTION 3: Overloaded methods Write the overloaded method named average () for each of the following problems: a) The first method receives THREE (3) integer values and returns

Write code in a java for automaton distributed in class, Write a code in a ...

Write a code in a c++/java  for the automaton distributed in the class that accepts keywords(cat,bat,cab). Create an input file along with these words may be two or three copies of

What is the actionform, ActionForm is javabean which shows the form inputs ...

ActionForm is javabean which shows the form inputs containing the request parameters from the View referencing the Action bean.

Write a java adb client, Write a Java ADB client to perform the following- ...

Write a Java ADB client to perform the following- The client will read the contents of the file - invoice.txt. The first line of the file will display the type of the currency. The

Convert string to super ascii, A string S is said to be "Super ASCII", if i...

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''''a''''-''''z'''') and

What are commonsense guidelines to prevent viruses, What are Commonsense Gu...

What are Commonsense Guidelines to prevent viruses? Discuss about Antivirus as well. Commonsense Guidelines to avoid viruses are as follows: 1. Do not open attachment of unwant

Project 7, Iterate through list of Fish. For each fish that isAlive, do th...

Iterate through list of Fish. For each fish that isAlive, do the following: * * 1. If this fishIsSurroundedByRocks, DO NOTHING, and move on to the next fish. * (This f

Write Your Message!

Captcha
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