Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE CODE THESE IN JAVA IntelliJ THANKS A TOUR COMPANY WOULD LIKE TO CREATE AN APP TO MANAGE THEIR CUSTOMER'S TOUR IN AUSTRALIA & MALAYSIA.

PLEASE CODE THESE IN JAVA IntelliJ THANKS

image text in transcribed

A TOUR COMPANY WOULD LIKE TO CREATE AN APP TO MANAGE THEIR CUSTOMER'S TOUR IN AUSTRALIA & MALAYSIA.

YOU ARE REQUIRED TO DESIGN A JAVA CLASS FOR THE APP BASED ON THE SPECIFICATIONS BELOW

Task 1 (W8 - 9 marks) Code the class shell, instance variables and default constructor (ctor) for a vehicle for the customers to choose on their trip. The class should be called Vehicle. A Vehicle instance has the following attributes: - regoNumber: length of 6 characters (you can assume all rego numbers are exactly 6 characters in length). eg. "15X6JD" or "WWW345". - mileage: distance that a vehicle can travel (eg. 400.0km for a SUV). Maximum will be 900.00km. - VehicleType: Can be only one of four categories of vehicle which are Sedan, SUV, Van and Minibus. Customer can only choose one of them for their trip. The default constructor must utilise appropriate naming conventions, initialised with sensible values and they protect the integrity of the class's instance variables. Task 2 (W8 - 6 marks) Code the getter/accessor methods for all the instance variables in task 1. Task 3 (W8 - 20 marks) Code the setter/mutator methods for all the instance variables in task 1 and at least one of the methods should return a boolean to indicate the success or failure of the mutation. The code must protect the integrity of the class's instance variables as required and utilise appropriate naming conventions. Task 4 (W8 - 5 marks) Code a tostring method for the class that outputs as below. Vehicle: SUV Rego Number: 1SX6JD Mileage: 400.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. At what stage are you in the family lifecycle?

Answered: 1 week ago