Java Programme

Java Programming — instructions say that 2 parallel arrays must be used for cabanas please

Code a complete solution to the following problem: in java

A Cabanas rental company wants you to design an application to keep track of their day-to-day rental process to a set of customers.

This application requires the use of parallel arrays (same tools and techniques used in class are required)

A given cabana is defined by the following attributes:

-Cabana Number: 3 digits

-Cabana Type: letters only: (possible DELUX or REGULAR code as ‘D’ and ‘R’ respectively))

-Maximum occupancy: 2 digits (all Delux type have a max occupancy of 4, all others a max of 10)

-Day Rental : real number (format: “####.##”)

-Availability: boolean (set to true if available or false if not)

-Days rented: max of 2 digits.

The Cabanas database is kept in two parallel arrays as follow:

Cabana ID : 101 , 102 , 103 , 104 , 105

Cabana type : D , R , R , D , R

Day rental rate : 54.95 , 25.75 , 39.99 , 95.85 , 40.75

Occupancy : 4 , 10 , 8 , 2 , 6

Availability : true , true , true , true , true

The customers’ database is kept in four parallel arrays as follow:

Customer ID: 100 elements

Customer first name: 100 elements

Customer last name: 100 elements

Cabana ID: 3 digits

Rental Balance: 100 elements

The declarations above create 100 elements for each of the attributes.

What to do?

a-In main(), declare an array for each of the attributes of a cabana.

b-call a method from main that load the data provided above for the cabanas into their respective arrays.

c- Also, in main(), declare all arrays for the customers (ID, first, last, balance). These are all empty when you start

1-Codea function that prompts the user with the following menu:

MENU

-1-Create a customer

-2-Process rental

-3-Search Customer

-4-Search for Cabana

-5-Search for a Rental

-6-Quit program

2-If user select ‘1’ from the MENU then call a function that prompt the user to enter the ID of a customer, first, last. Rental balance at this level is left out until ‘Rental process’.

ID’s must be 6 digits.

First and last must be alphabetical.

3-if user select ‘2’, then prompt the user to enter an ID, call a function that search for this ID, and if found, call a function that process rental. If ID does not exist, then notify user with a suitable message that he/she must create an account then display menu back again.

4-The function that processes rental will prompt the user to enter a Cabana ID, and then call a function that searches for this Cabana ID and if found, check if it is available, and if it is, then prompt user to enter how many persons (reject if above the max occupancy) then select how many days the cabana is needed .

5-When option ‘3’ is selected quit program.

6-Add the necessary routines that repeat program for different options in the menu.

Important! Declare all necessary variables in main()…you may need other variables (working variables) either in main only or within a specific function(s).

Extra credits:

-convert the whole program using Object Oriented Approach (must submit a different version in addition to the required version)

× How can I help you?