Java Code

  1. Movie Class 10 POINTS
    Write a class named Movie that has fields to hold the following data:

    • Title
    • Studio Name
    • Year produced
    • Rating
    • In the Movie class, also include
    • A mutator (setter) method for each field to set the value for the field
    • An accessor (getter) method for each field to get the value for the field
    • Write a separate demo program (ex: HARDYL_J5B) that utilizes the class by creating three instances of the class and printing the info in them and test all methods in the class.
      Hints/Tips:
    • You’ll have one program (Movie) for the movie class, and the demo program (HardyL_J5B)
    • In the Movie class, define your fields, then your methods
    • In the demo program, instantiate
    • It took me about 30 minutes
    • Rubric:
    • Doesn’t have the class defined -10 (no credit for this part of the assignment)
    • Doesn’t have all the fields defined -.5 per field missing
    • Doesn’t display the result -1
    • Demo program doesn’t test the methods in the class -1
    • Missing demo program -4
  2. Using Java Two C, create a class called Order (ex: p351) that has the following fields:
    • entree A char that holds the person’s burger order
    • drink A char that holds the person’s drink order
    • dessert A char that holds the person’s dessert order
    • The class should have the following methods defined:
    • default constructor – Sets all values to blank
    • Constructor#2 – Accepts an order’s entrée, drink, and dessert selection
    • setEntree – Accepts a char argument that is copied to the entrée field
    • setDrink – Accepts a char argument that is copied to the drink field
    • setDessert – Accepts a char argument that is copied to the dessert field
    • getEntree – Returns the value in entrée
    • getDrink – Returns the value in drink
    • getDessert – Returns the value in dessert
    • getPrice Returns the price of the three items in the order
    • Write a demo program (ex: HARDYL_J5D) that instantiates three people’s orders.  Allow the user to enter the orders.  Display each person’s order price and a total for the entire bill. 
      Example:
      Person #1            $7.00
      Person #2            $8.50
      Person #3            $10.25
      Total                    $25.75Hints/Tips:
    • Your output can look like the example, or you can change it, but make it clear. For example, you might have a column heading for Person and put #1 under the heading.
    • You can also use different field & method names but call your class Order.
    • You do not have to return the description for the selections.
    • Get price will have the same code used in Java 2D, except for description
    • The demo program will have similar code to Java 2D, but you do it 3 times.
    • Don’t worry about validating the input values (you should in business, but I don’t want this to be too complicated/time-consuming for you).
    • Be sure your demo program tests all methods of the class. For one person, get all the values and pass them all back. For another person, instantiate the order, then set the individual values one at a time.
    • When formatting output, you might have to use multiple tabs (t) to align the data.
    • It took me about 35 minutes
    • Rubric:
    • Doesn’t create Order class -10 (no credit for this part of the assignment)
    • Doesn’t create a Demo program -5
    • Doesn’t have all the class fields -1/per field (3)
    • Doesn’t have all the class methods -.5/per method (9)
    • Doesn’t calculate price -2
    • Doesn’t display results -3
    • Doesn’t display correct total -1
Tags: No tags