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

  Review concepts related to threads

To review concepts related to threads. Modify this code so that the method instead waits until it has been notified that a new task has been created.

  Create a circle class

create acircle class, which has one field, the radius. the class should contains two constructors: a no-argument constructor that set the radius to zero, and a constructor that takes a parameter to set the radius.

  Create an application for an animal-fur trimming service

create an application for an animal-fur trimming service. the business is open 15 weeks of the year from april through

  Write player classes that have certain behaviour

Write player classes that have certain behaviour. These classes will lead you along to implementing the players you will need for the project.

  Critics of american often that teacher''s unions represent

Which organization has proposed a set of standards for both elementary level and secondary-level teachers? According to the latest info.,  teachers will be most needed in which of the following areas: Critics of American often argue that teacher's un..

  Simulate traffic lights using the concept of multithreading

Each light has two statuses, "on" amd "off". Moreover, the time of each light switching status can be set using the text input box beforehand

  Starting hand gesture for the computer

You will develop a webpage that will allow the user to play Rock- Paper- Scissors against the computer.

  Create a more general employee superclass

Create a Driver class to test your new CommissionEmployee class. Prompt the user to input the first name, last name, social security number, gross sales

  Write a java program named showescapesequences

Write a Java program named ShowEscapeSequences.java that displays the following. This tutorial shows you how to use Eclipse that you just installed. If you are using Eclipse under Citrix, you must choose the F.

  Write a program that reads a file name from the keyboard

Write a program that reads a file name from the keyboard. The file contains integers, each on a separate line. The first line of the input file will contain the number of integers in the file. You then create a corresponding array and fill the array ..

  Compute the amount of array value

Compute the amount of array value and Echo a span with id 'result' that contains the value - Receive the four values posted

  Represent relationship between the students and the courses

1. Implement relationship using a java program. Assume each course has a course title, code, subject and number of credits while each student has a name, registration number, list of courses that the student follows and the marks for each course.

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