• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Stuck on a netbeans project

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
below is my project and im trying but it keeps compiling with errors idk why, I did the first three parts but idk how to continue.




Car Rent Company
In this project, we aim to propose an application for Car Rent Company. The application is
responsible for storing all cars in the company and their characteristics. It helps managing
renting cars, storing the clients, relating car to clients, managing available cars, etc. The main
entities are:
 The client: defined by a name as String, a SSN as integer, a phone number as String, and
an address as String. All these parameters must be initialized in the constructor.
 The car: defined by a name as String, a color as String, an ID as integer, a Chassis
number as integer, an available status variable as boolean that indicates if the car is
available when true or not available when this flag is false, the regular renting price as
double, the number of times this car is rented (this number is initialized as 0 and
increases each time the this is successfully rent), the maximum allowed number of
renting and the date of owning the car (it is the date when the object car is created) by
the company as date. The car class also contains a changeable size array with all
transactions (transaction is when a client rent a car).
A constructor must takes as parameters the name, the color, the Chassis number, and
the ID. The id should be unique and not similar to any other ID. The transactions list is
initially empty, but must be created.
The car also contains the following methods:
o void rent_car () to rent a car, which means to update the available status
from true to false. If the available status is already false, then the method print
out “The car is already rented”.
o void return_car () to return a car, which means to update the
available status to true. If the available status is already true, then the method
print out “This car is not rented, then you cannot return it”
o double calculate_price() that calculates the price depending on the
type of the car.
o For these three methods you have to take into account the requirements in the
description hereafter.
 The rent transaction: defined by its transaction number that is unique for each
transaction (it increments automatically by one, for example, the first created
transaction has the Number 1, the second created transaction has the number 2, etc.),
the rented car of type car, the client who rented the car as client class type, the date
when the transaction is created, and the price of renting using the method
calculate_price of the corresponding car in this transaction object. All the data
must be initialized in the constructor and given as parameters except the price of the
renting. A transaction must have a toString() that describe the object of type
transaction.
 The normal car is a car with a maximum duration of rent as integer set in the
constructor, and a discount special to each car. The method calculate_price is
implemented in this class, and calculate the price as follows. The returned price is the
regular price multiplied by (1- the number of times this car is rented)*(1-discount/100).
 The bus is a car with capacity given as an integer. The method calculate_price is
implemented in this class, and calculate the price as follows. The returned price is the
regular price multiplied (1 - capacity/30).
The application should be able to accomplish the following operations:
 Rent a car.
 Return a car.
 Calculate the price of renting a car.
 When any of the operation rent_car() is called, a transaction is created and added
to the array of transactions of the car object.
 In the class car, create a method printTransactions() to print all transactions
details.
 Create a toString() method in the car class to display all information related to the
car.
 In the class car, create a method display_trans_dates(date d1, date d2) that
displays all transactions between two given dates in a given account.
 Any rent operation of a car cannot exceed the maximum allowed number of renting,
and in this case the operation is rejected.
 The car class must be able to sort its Transactions list in ascending or descending order
by date (here the Transaction class must implement the interface comparable).
 There should be a customer file that save all the clients objects, and a car file that save
all cars objects. Before closing the program, all clients and cars should be saved, and
when starting a program, the clients and cars should be loaded from the two files.
Implement all the above classes, with the required data field, constructors, and methods. The
methods of the classes must cover all the operations and requirements described above.
In your main, create an arraylist with five cars and create three clients. Apply six renting
operations of your choice (a renting operation can be done by calling the car object with the
method car_rent()). Return four of the six renting operations.Show all the transactions for
each of the cars.
Create a method called display price that display the price of the created cars list, and if the car
is a bus the method print “The bus renting price is --price-- ” and if the car is a normal car the
method print “The car –name of the car- renting price is –price-“
On running the application, the agent will get a welcoming message. When you close the
window, your program is about to close, therefore you should save all data (clients and cars in
the files Client.dat and Car.dat). When you re-run the program, it should first load the files
Client.dat and Car.dat into the program (into arraylists), and then start the program.
 
bob denver
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
 
Marshal
Posts: 25594
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, bob!

I moved your post to the Beginning Java forum because it looks like that's where it belongs. If you'd like to provide some details about your question, that would be greatly appreciated.
 
Rancher
Posts: 4576
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to post the compilation errors here, and the code (in code tags).
 
    Bookmark Topic Watch Topic
  • New Topic