Create a new multi-class java program

Assignment Help JAVA Programming
Reference no: EM131585489

Project Assignment

Please do the following to complete this assignment.

Purpose:

The purpose of this project is to provide non-trivial practice in the use of Java object-oriented programming features to implement an object-oriented design and have a bit of fun doing it.

Resources Needed:

You will need a computer system with Java 7 or greater SE edition run-time and Java Development Kit (JDK). You may optionally use a Java IDE for example NetBeans, Eclipse, etc. However application builders are not allowed.

Submitted Files:

Design and Analysis:

This is an informal essay-style single-spaced word-processed document. The file formats accepted will be announced at project assignment. The length of the document should be between 1 and 1.5 pages. The following subjects should be discussed in this order:

1. General program design. How is the program organized? What major data structures were used? How did you divide the functionality among your classes? How are commands processed? Etc.

2. What alternative approaches were considered and why were they rejected?

3. What did you learn from doing this project and what would you do differently?

Source files:

Each public class must be contained in a separate Java source file. Only one source file will have a main() method and this source will be named VendingMachineSimulator.java. Other source/class names are up to you following the guidelines specified so far in the course.

The format of the Java source must meet the general Java coding style guidelines discussed so far during the course. Pay special attention to naming guidelines, use of appropriate variable names and types, variable scope (public, private, protected, etc.), indentation, and comments. Classes and methods should be commented with JavaDoc-style comments (see below). Please use course office hours or contact the instructor directly if there are any coding style questions.

JavaDocs:

Sources should be commented using JavaDoc-style comments for classes and methods. Each class should have a short comment on what it represents and use the @author annotation. Methods should have a short (usually 1 short sentence) description of what the results are of calling it. Parameters and returns should be documented with the @param and @return annotations respectively with a short comment on each.

JavaDocs must be generated against every project Java source file. They should be generated with a -private option (to document all protection-level classes) and a -d [dir] option to place the resulting files in a javadocs directory/folder at the same level as your source files. See the JavaDocs demonstration for more details.

Submit file:

The submit file is to be a Zip file containing your design and analysis document, your Java sources, and your javadocs directory/folder. Any appropriate file name for this Zip file is acceptable.

If you know how to create a standard Java JAR file, this is also acceptable for your source code. However, make sure you include the source code in your JAR file.

Collaboration:

It is encouraged to discuss technical or small design parts of this project with your fellow students. However the resulting design and implementation must be your own. For example, it is acceptable to discuss different ways of maintaining the vending machine state but not detailed design or implementation information on processing the purchase command. When in doubt, ask during office hours or contact your instructor. Program Specification:

1. Create a new multi-class Java program which implements a vending machine simulator which contains the following functionality:

A) At program startup, the vending machine is loaded with a variety of products in a variety of packaging for example soda/tonic/Coke in bottles, peanuts in bags, juice in cartons, etc. Also included is the cost of each item. The program should be designed to easily load a different set of products easily (for example, from a file).

Also at program startup, money should be loaded into the vending machine. Money should consist of different monetary objects for the specified currency for example $1 bills, $5 bills, quarters, dimes, etc. Your program should be designed to use different national currencies easily (for example the Euro) without changing source code. Money should be maintained as paper bills and coins, not just amounts.

B) A menu of commands must be provided. At a minimum the menu should consists of the following commands:

1. Display the list of commands
2. Display the vending machine inventory. For each item, this command should result in displaying a description and current quantity.
3. Display the money currently held in the vending machine.
4. Purchase an item. The result of this selection should be the following actions:

1. Prompt the user to indicate what item to purchase

2. Prompt the user to specify what monetary items are being used for payment (the actual items for example quarters, dimes, etc.), not a money amount

3. If the user specified enough money to purchase the selected item, the item is purchased (deducted from inventory), supplied money is added to the vending machine, and any change is returned in the form of monetary items (quarters, dimes, etc.).

4. If the user did not specify enough money for the selected item, the transaction is aborted with the supplied money not added to the machine (not accepted) and the product not purchased (i.e. the state of the vending machine is unchanged).

5. Exit - exits the program displaying a departing message.

2. Additional points to consider:

A) You can use the Java Standard Edition (SE) API library as supplied by Oracle (AKA Sun) except the collection classes other than String and standard arrays (i.e. not ArrayList, Map, Vector, etc.). These other collections will be covered later in the course.

B) When developing complex classes, consider creating a main() method to test them out. Once tested successfully, delete the main() method.

C) You should generate error messages when appropriate, for example on invalid input values or not enough money supplied for the selected item to purchase. Exceptions will be covered later in the course so for this program displaying appropriate messages on the console is fine.

Other Activates:

1. Observe the presentation on JavaDocs.
2. Observe the Vending Machine Simulator demonstration for an example of one implementation.
3. Create a compressed zipped folder containing your Design and Analysis document, your Java source code files, and your javadocs folder.
4. Submit your compressed zipped folder as directed by your instructor.

Reference no: EM131585489

Questions Cloud

What are the five forces in porter model : What are the five forces in Porter's model? Describe how these forces can impact a technology firm.
Explain characteristics of effective health care leadership : Analyze one's leadership strengths and weaknesses, in reference to one or more leadership theories or styles found in the literature.
Three major organizational forms : Examine the advantages and disadvantages of each form and discuss some of the critical factors that might lead you to choose one form over the other.
How much higher would japanese annual earnings growth rate : how much higher would the Japanese annual earnings growth rate have to be?
Create a new multi-class java program : Create a new multi-class Java program which implements a vending machine simulator which contains the following functionality.
Construct a geometric structure from a set of lines : We are going to construct a geometric structure from a set of lines using a finite number of points in the plane.
Firm be willing to wait until project starts generating cash : Approximately how many more years than the U.S. firm would the Japanese firm be willing to wait until the project starts generating cash?
New york stock exchange operates and way nasdaq operates : Explain the differences between the way the New York Stock Exchange operates and the way NASDAQ operates in 5-6 sentences
Describe toyota underlying concept of ethics : Describe Toyota's underlying concept of ethics for supply chain management.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a program that displays a string welcome to java

Write a program that displays a string Welcome to Java around the circle, as shown in Figure

  Java format using netbeans ide

Having issues with the questions and getting it to work in a java format using NetBeans IDE - constructor that calls the parent's default constructor

  Write java application that asks user to enter two integers

Write a Java application that asks a user to enter two integers (A and B) and then display the results of A/B. Catch any division by zero errors and prompt the user to reenter the value of B. Be sure your code compiles and runs as expected. Name y..

  Design a program to help a videorental store

Design classes (class video, class customer, etc) based on your analysis above, using LINKED LISTS for the database elements read into the main memory.

  Implement the program to see the value in planning first

Implement the program to see the value in planning first, coding later. While coding is the glamorous part of the job, software development is a process with

  Write a program using bucket sort idea to create histograms

The input data are in an external file named election.txt. The first line is an integer N representing the number of candidates. The next N lines are the names of the canditates.

  Write a method named is all vowels that returns

Write a method named isAllVowels that returns whether a String consists entirely of vowels

  Write a generic linked list tree

Write a generic linked list tree and a generic linked list binary search tree class that inherits from your generic linked tree class

  Create an application that provides a solution

Create an application that provides a solution for problem 20.8 In addition to requirements specified in the description.

  Implementation of a simple java class

The purpose of this lab is to gain experience in the design and implementation of a simple Java class.  You will create a class definition and write a simple main method that will test the methods of your class to ensure they work as expected.

  Create a fully complete educational mobile game

You will individually create a fully complete educational (school-age) mobile game using mobile web design skills. You will submit your completed application's project folder as a zip file

  Write a class named retailitem

Write a class named RetailItem that holds data about an item in a retail store. The class should have the given member variables:

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