Write a Java version of class CarExhibition

Assignment Help JAVA Programming
Reference no: EM133325160

Computer Programming (JAVA)

Question 1. The following UML Class Diagram is provided. Implement all the classes in the Class Diagram. Staff class is abstract with abstract methods getPaid and toString methods are calculated as follows:
For Manager, returns the sum of salary and allowance.
For Technician, returns the sum of salary and overTimePay.
The toString methods return the following String:
o For Manager, returns name, salary, allowance, and paid in a String.
Sample: Manager: name = Siti, salary = 4000.0, allowance = 1500.0, paid = 5500.0
o For Technician, returns returns name, salary, over.mePay, and paid in a String
Sample: Technician: name = Ali, salary = 2000.0, overtimePay = 1200.0, paid = 3200.0

454_Computer Programming.jpg

 

Question 2. Write class Employee that has fields for employee's name, ID, and salary. The Employee class has also another field called address which is of type class Address. Class Address has fields for the street name, house number, and city. Include in class Employee any suitable accessor and mutator methods and write a method called displayInfo that display all information of an Employee.

Question 3. A hospital wants to create a database regarding its indoor patients. The information to store include
- Name of the patient
- Age of the patient
- Disease
- Date of admission
- Date of discharge

Create a class called Patient to store the above information. The member methods should include methods to enter information and display the patient's information.

Create class Date to have the date (year, month and day as its fields) and a method to display the date.
Create class Hospital to have an array list to store all patients. It has methods to add a patient to the list and
to delete a patient from the list. It also has a method to display a list of all the patients in the hospital and a method to display only the patients whose age is less than 12.

Question 4. Create a class named Movie that can be used with your video rental business. The Movie class should track the Motion Picture Association of America (MPAA) rating (e.g., Rated G, PG-13, R), ID Number, and movie title with appropriate accessor and mutator methods. Also create an equals() method that overrides Object 's equals() method, where two movies are equal if their ID number is identical. Next, create three additional classes named Action , Comedy , and Drama that are derived from Movie . Finally, create an overridden method named calcLateFees that takes as input the number of days a movie is late and returns the late fee for that movie. The default late fee is $2/day. Action movies have a late fee of $3/day, comedies are $2.50/day, and dramas are $2/day. Test your classes from a main method.

Question 5. Consider the following class hierarchy where Class Car is the supper class and the classes ClassicCar and
SportCar are two subclasses derived from Car.

Class CarExhibition contains a filed of type ArrayList that stores objects of type Car.

268_Computer Programming1.jpg

 

a. Class Car is an abstract class .Write a Java version of class Car assuming it has this constructor:public Car(double price, int year) and that the method calculateSalePrice ( ) is abstract.

b. Write a Java version of class ClassicCar assuming it has this constructor: public ClassicCar (double price, int year) and that the method calculateSalePrice ( ) returns 10,000 as the sale price of the car.

c. Write a Java version of class SportCar assuming it has this constructor: public SportCar(double price, int year)
and that the method calculateSalePrice ( ) calculates the sale price of the car as follow:
if year > 2000 then the sale price is 0.75 * its original price; if year > 1995 then the sale price is 0.5 * its original price; otherwise the sale price is 0.25 * its original price

d. Write a Java version of class CarExhibition assuming it has this constructor: public CarExhibition( ) where CarExhibition has cars of different types stored in an arraylist and getTotalPrice method that returns the total prices of all cars in the exhibition.

Reference no: EM133325160

Questions Cloud

Organisations exist at governmental level : Organisations exist at the Governmental level - typically the various government departments e.g. health, child protection
Why would the alerting function be important : What value would aggregations and calculations provide that cannot be provided by the raw or processed logs themselves?
Discuss reason for and importance of case management : Discuss the reason for and importance of case management when needed.
The world bank. climate change : What is climate finance? Provide a couple of examples of the World Bank's leadership/involvement in climate change issues.
Write a Java version of class CarExhibition : TIT 611 Computer Programming (JAVA) Write a Java version of class ClassicCar assuming it has this constructor: public ClassicCar (double price, int year)
Workplace accessible solely about reasonable accommodations : Is making the workplace accessible solely about reasonable accommodations, or is there something more critical that has to change:
Who identifies as homosexual : Olivia is a 17-year-old female who identifies as homosexual. Describe the activities you will use and how they will be used to help strengthen the family.
What is mac address filtering and why is it useful : What is the difference between personal vs enterprise authentication? What is MAC address filtering and why is it useful?
What are impacts of declining nuclear families : What are the impacts of declining nuclear families? Why are nuclear families decreasing?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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