Objectives

1. Enjoy it!
2. JOptionPane
3. Loops
4. Arrays
5. Classes
6. Try/Catch Validation
7. Static / Class variables
8. Inheritance

1. You are to write a simple java program that accepts input from the user, perform some calculations, and then generates output. The program simulates placing an order at a store.

a. Prompt for customer information
b. Prompt for a product
c. Prompt for a product quantity
d. Prompt user if they want to add additional products
e. After all products and their quantities have been entered display a receipt

2. Use a package in your project, the package name should be xxxprojectname.

3. Read in the following from the JOptionPane input window:

a. Customer First Name
b. Customer Last Name
c. Customer Address
d. Customer City
e. Customer State
f. Customer Zip
g. Customer Phone Number
h. Customer MemberShip Number

4. Select a product from the Menu Screen

5. Enter a quantity using JOptionPane input window

6. Prompt to select more products & quantities

7. Display a summary receipt

8. Validation

a. First Name, Last Name, Address, City are not blank
b. State is not blank and is only 2 characters
c. Zip is not blank and is 5 digits (5 numbers no characters)
d. The phone number of the customer is not blank and is 10 digits (10 numbers no
characters)
e. Customer Membership number is not blank and has 2 characters and 4 numbers
f. Product quantity is an integer between 1 and 10

CLASSES

  • CLERK (inherits Person) Holds information about clerk processing the order
  • CUSTOMER (inherits Person) Holds customer information
  • JAVAZON Hold information about the store, contains orders
  • JAVAZONAPP Controller, collects information from user, display result
  • MENU Holds information about the menu consists of products
  • ORDER Holds information about order, contains products
  • PERSON Parent class holds information about person
  • PRODUCT Class to hold product information
  • VALIDATOR Class to perform validation
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.