Results 1 to 3 of 3
  1. #1
    EdOBannon is offline Member
    Join Date
    Nov 2011
    Posts
    12
    Rep Power
    0

    Default Java -- inheritance, exceptions, etc.

    I am having trouble with this assignment. Any help is much appreciated.

    Description
    For this assignment you will create a program that simulates a pizza ordering system that allows a user to choose a small, medium, large, or xlarge pizza and load it with up to 12 toppings, then display a detailed summary of the order with the total cost amount and store the order to a file in memory called “OrderHistory.txt”.
    Requirements
    1. There should be 7 classes:
    1. 1. Checkout.java
    2. 2. Pizza.java
    3. 3. SmallPizza.java
    4. 4. MediumPizza.java
    5. 5. LargePizza.java
    6. 6. XlargePizza.java
    7. 7. PizzaTestDrive.java


    2. You must use object oriented design (OOD).
    3. You must use inheritance.
    4. The assignment hierarchy MUST adhere to the following structure (but use your own class names):
    Java -- inheritance, exceptions, etc.-hierarchy.png

    5. Checkout interface explanation:
    0. getTotalPrice returns the total price of the order
    1. saveOrder saves all the order details to a local file on the system “OrderHistory.txt”.

    6. Pizza class explanation:
    0. toppings is an ArrayList of Strings used to store the toppings ordered for the pizza
    1. getToppings gets the reference variable to the toppings ArrayList
    2. addTopping takes in a topping String argument and adds it to the toppings ArrayList
    3. numOfToppings gets the number of toppings ordered, that is the size of the topping ArrayList

    7. Small, Medium, Large, and Xlarge Pizza classes explanation:
    0. toppingPrice is an instance variable that holds the price of the toppings: $0.25 for a small, $0.5 for a medium, $0.75 for a large, and $1 for a Xlarge
    1. PizzaPrice is an instance variable that holds the price of the pizza: $4 for a small, $8 for a medium, $10 for a large, and $12 for a Xlarge

    8. Your PizzaTestDrive class must welcome the user and ask what size pizza they want, then what toppings they want on the pizza, and finally display their order details and total price, as well as write all the order information to the file “OrderHistory.txt”.

    9. There MUST be the following topping choices:
    pepperoni green peppers
    sausage hot peppers
    ham green olives
    bacon black olives
    mushrooms pineapple
    onion anchovies

    11. The correct use of access levels must be used in all classes: i.e. use the ‘private’, ‘public’, and ‘protected’ keywords where appropriate.
    12. ALL exceptions MUST be caught in a catch block.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default Re: Java -- inheritance, exceptions, etc.

    Your question as asked isn't really answerable. I suggest you read through the link in my signature on asking questions the smart way. Where exactly are you stuck?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default Re: Java -- inheritance, exceptions, etc.

    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Java Help - Inheritance and OOP
    By EdOBannon in forum New To Java
    Replies: 4
    Last Post: 11-06-2011, 03:48 AM
  2. Java Help - Inheritance
    By EdOBannon in forum New To Java
    Replies: 5
    Last Post: 11-06-2011, 02:18 AM
  3. Java exceptions
    By holtaf in forum New To Java
    Replies: 1
    Last Post: 07-04-2011, 03:55 PM
  4. Inheritance in Java
    By socboy6579 in forum New To Java
    Replies: 2
    Last Post: 02-08-2011, 04:40 PM
  5. Client catching Web Service User Exceptions [Java 6.0.17]
    By Shaitan00 in forum Advanced Java
    Replies: 4
    Last Post: 11-22-2009, 01:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •