Create an enum type and say cartype

Assignment Help JAVA Programming
Reference no: EM132098942

please need help with the java program

A micro car rental company.

package yourLastName.cis4110.assignment5;

Please create an enum type, say Cartype, featuring all rental car types -- SUBCOMPACT, COMPACT, MIDSIZE, FULLSIZE

(You may put the enum definition in Car class)

class Car

Instance variables:

- private String plateNum

- private Cartype carType

- private boolean availability

Member methods:

- Please define all setters and getters

class RentACar - This is a five car system for prototyping

instance variables:

- Car rentalCars[5] //a constant size so that you don't have to worry about handling the flexible size of the array.

member methods:

- public void setRentalCars(Car[] rentalcars) // array as a formal param

- public Car[] getRentalCars() //array as a return type; pay attention to deep copy

- public String rentACar(cartype) // eg. rentACar(Car.cartype.COMPACT);

return plateNum if available, otherwise null or empty string "" //search through the rental car list and find the first available car of the type matching the argument; //Please note, once the car is rented, the car's availability should be set to false or 0.

-returnACar(platNum) //Reset the car's availability to true

classManageCars// or any name if you'd like. Put your main() function here to test your program.

In your main()

1). You may manually create five Car objects here, say Car[] myRentalCars = new Car[5]. No need to use Scanner to ask user to input data to save time. e.g.: You may directly put - rentalCar[0] = new Car(); rentalCar[0].setPlateNum("P1"); rentalCar[0].setCarSize(Car.rentalcar.COMPACT); rentalCar[0].setAvailability(true); or using a Car constructor of three parameters e.g.: new Car("P1", Car.rentalcar.COMPACT,1);

2). Create a CarRental object, say myRental

3) myRental.setRentalCars(myRentalCars);

4) Put a few calls to rentACar() and returnACar() of myRental to test your program. e.g.: myRental.rentACar(Car.cartype.COMPACT); myRental.rentACar(Car.cartype.MIDSIZE); myRental.returnACar("PlateNo1");

To add any additional properties, methods if necessary

Reference no: EM132098942

Questions Cloud

Design a java application to read : Then design a Java application to read all data from the file echoing the data to standard output. After all data has been read, display how many data were read
How to include static method named printdetails : How to include static method named printDetails() that will produce an employee details report, also include a static method named
Display the prime numbers similarly : Find the prime numbers from 2 to 1000. 1 is an index not a prime number
What do you think Workforce Dynamics means : What do you think Workforce Dynamics means? Find an article from a reputable source that helps to explain "Workforce Dynamics"
Create an enum type and say cartype : Please create an enum type, say Cartype, featuring all rental car types -- SUBCOMPACT, COMPACT, MIDSIZE, FULLSIZE.
Write Research Paper related to HRM : Students will select among a provided list of relevant HR "hot" topics which currently have an impact on HRM
Explain the concept of unified change management : Describe the concept of "change request" in your own words. List down the activities performed by "Software Review Board" in the change request process.
Identify components used in building an IT infrastructure : SBM4104 IT Infrastructure Assignment - Poster. Identify and classify the different components used in building an IT infrastructure
Write a program to simulate processing of a packet : Write a (simple) program to simulate processing of a packet at a router interface with an ACL bound to that interface.

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