QuestionQuestion

Problem:
Gulf Insurance Company is in need of software to calculate the insurance amount for the vehicle based on its type and model. The following is the description of the problem.
A Vehicle can be identified by color, and number.
A Car is a Vehicle having details of classification (sedan, hatchback, SUV …), company (Ford, Toyota, Hyundai …), and model (year of manufacture).
A Bus is a Vehicle having details of seatCapacity, route, and transport (GTS, SLT, Mwasalat … ).
PersonalBoard is a Car having details of ownerName and mobileNumber.
TaxiBoard is a Car having details of Source and Destination.
Interface method needed:
Create an interface by name Insurance. The requirements are listed below:
InsuranceDetails method that should provide insurance amount for every type of vehicle based on the below conditions.

Vehicle                                    Condition                         Amount in Rials
Bus                                     No Condition                                     50
PersonalBoard         Model is on or before the year 2000       10
                                 Model is from the year 2000 and
                                 lower than or equal to 2010.                     15
                                        Model is above 2010                            25
TaxiBoard                Model is on or before the year 2000       15
                                 Model is from the year 2000 and
                                 lower than or equal to 2010.                      25
                                 Model is above 2010                                  35
Use necessary validations using exceptions and user-defined exceptions.
When there is requirement of printing details of insurance, the program should display all the details of the vehicle including the insurance detail.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

/**
*
* @author
*/
public class Bus extends Vehicle {

    /**
    * A Bus is a Vehicle having details of seatCapacity, route, and transport
    * (GTS, SLT, Mwasalat … ).
    */
    private int seatCapacity;
    private String route;
    private String transport;

    /**
    * default constructor
    */
    public Bus() {
       seatCapacity = 0;
       route = "";
       transport = "";
    }

    /**
    * constructor
    *
    * @param seatCapacity
    * @param route
    * @param transport
    */
    public Bus(int seatCapacity, String route, String transport) {
       this.seatCapacity = seatCapacity;
       this.route = route;
       this.transport = transport;
    }

    /**
    * constructor
    *
    * @param seatCapacity
    * @param route
    * @param transport
    * @param color
    * @param number
    */
    public Bus(int seatCapacity...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$15.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats