Question: Intro to JAVA Course: -------------------------------------------- Complete the class below that uses static methods to track how many rental cars are rented and available. A newly

Intro to JAVA Course:

--------------------------------------------

Complete the class below that uses static methods to track how many rental cars are rented and available. A newly constructed rental car is available for rental.

/** A rental car with static methods to count rented and available cars. */ public class RentalCar { private boolean rented; private static int . . .; private static int . . .;

/** Constructs a rental car. */ public RentalCar() { // your work here }

/** Get number of cars available. @return count of cars that are available */ public static int numAvailable() { // your work here }

/** Get number of cars rented. @return count of cars that are rented */ public static int numRented() { // your work here }

/** Try to rent this car. @return true if the car was successfully rented, false if it was already rented */ public boolean rentCar() { // your work here }

/** Return rented car. @return true if the car was previously rented and is now returned, false if it was not previously rented */ public boolean returnCar() { // your work here } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!