durgaramesh
06-12-08, 07:33 PM
Classes
The cars are to be implemented with a Car class. The class should hold at least the following data:
make (string)
model (string)
registration number (string)
driver (Person)
The Car class should implement at least the following methods:
getMake(self) returns the make of the car
getModel(self) returns the model of the car
getRego(self) returns the registration number of the car
getDriver(self) returns the driver of the car
setDriver(self, driver) sets the driver of the car to driver (type Person)
The Car class will also need to implement methods to hire and return the car as well as indicate if it is able to be hired out.
The drivers are to be implemented with a Person class. The class should hold at least the following data:
firstName (string)
lastName (string)
The Person class should implement at least the following methods:
getFirstName(self) returns first name of person
getLastName(self) returns the last name of the person
setFirstName(self, name) sets the first name of the person to name
setLastName(self, name) sets the last name of the person to name
You may implement other methods as you deem necessary.
The initial data for the hire car company is to be read from the hireCar.txt file supplied. Your program should implement correct error handling so that the program does not crash if the file is not available, but give an acceptable, informative error message and gracefully close, not crash.
The program should implement a menu system that allows the following functionality:
List the cars by colour
List the cars by make
List the cars available
Hire out a car
Return a car
Add a car to the list
Delete a specific car from the list
Exit the program.
Your program should implement sufficient error control so that if the user enters an unexpected menu choice, the program will give an error message and represent the menu, not crash.
Your program should give an error message to the user if an illegal activity is attempted, such as:
attempting to hire a car that is currently hired
attempting to return a car that is not currently hired
attempting to delete a car that is currently hired
On exiting the program the data held in the car list should be written to a file. Your file handling code should also implement correct error control.
CHALLENGE TASK -> (To be undertaken after the other parts have been completed)
Implement a GUI class to run the program through a GUI. All the interaction with the user should be through the GUI, with the possible exception of getting new drivers names for hiring purposes. Your interface should implement buttons (from the buttonClass developed in class) to perform the following functions:
show the first car on the list,
show the last car on the list
step through the car list from first to last
step through the car list from last to first
add a car to the list
delete a car from the list
exit the program
Error message should be given to the user if they attempt any illegal activities, such as:
attempting to step off the end of the list (ie asking for the next car when the last one is displayed
attempting to step off the start of the list (ie asking for the previous car when the first one is displayed
attempting to hire a car that is currently hired
attempting to return a car that is not currently hired
attempting to delete a car that is currently hired
On exiting the GUI interface, you program should write the data held in the program to a file.
CARS LIST:
red Holden Barina ABC123 Unknown Unknown
blue Holden Barina ABD123 Unknown Unknown
green Holden Barina ABF123 Unknown Unknown
yellow Holden Barina ABH123 Unknown Unknown
black Holden Barina ABE123 Unknown Unknown
white Holden Barina ABJ123 Unknown Unknown
silver Holden Barina ABU123 Unknown Unknown
red Holden Commodore BCX344 Unknown Unknown
blue Holden Commodore XXD344 Unknown Unknown
green Holden Commodore BCH344 Unknown Unknown
yellow Holden Commodore BHD344 Unknown Unknown
black Holden Commodore HCD344 Unknown Unknown
white Holden Commodore BCO344 Unknown Unknown
silver Holden Commodore BCD344 Unknown Unknown
red Ford Fiesta ASD345 Unknown Unknown
blue Ford Fiesta ASD645 Unknown Unknown
green Ford Fiesta ASD365 Tom Jones
yellow Ford Fiesta ASD346 Unknown Unknown
black Ford Fiesta ASD845 Unknown Unknown
white Ford Fiesta ASD385 Unknown Unknown
silver Ford Fiesta ASD348 Sammy Davis
red Ford Falcon JRE987 Unknown Unknown
blue Ford Falcon TJE987 Unknown Unknown
green Ford Falcon TRJ987 Fred Nerke
yellow Ford Falcon BRE987 Unknown Unknown
black Ford Falcon TBE987 Unknown Unknown
white Ford Falcon TRB987 Unknown Unknown
silver Ford Falcon TGE987 Unknown Unknown
red Mazda Bravo MFE645 Buffy Summers
blue Mazda Bravo VME645 Unknown Unknown
green Mazda Bravo VFM645 Unknown Unknown
yellow Mazda Bravo NFE645 Skippy Kangaroo
black Mazda Bravo VNE645 Unknown Unknown
white Mazda Bravo VFN645 Unknown Unknown
silver Mazda Bravo KFE645 Unknown Unknown
red Mazda 323 ADV543 Unknown Unknown
blue Mazda 323 BAV543 Unknown Unknown
green Mazda 323 BDA543 Unknown Unknown
yellow Mazda 323 FFV543 Unknown Unknown
black Mazda 323 BDF543 Unknown Unknown
white Mazda 323 BFV543 Ricky Ponting
silver Mazda 323 JDV543 Unknown Unknown
red Nissan Tida MGE543 Unknown Unknown
blue Nissan Tida NGE543 Unknown Unknown
green Nissan Tida JGE543 Unknown Unknown
yellow Nissan Tida KGE543 Unknown Unknown
black Nissan Tida BKE543 Unknown Unknown
white Nissan Tida BKE543 Unknown Unknown
silver Nissan Tida BGL543 Unknown Unknown
red Nissan Pathfinder RRR999 Dick Smith
blue Nissan Pathfinder LLL999 Unknown Unknown
green Nissan Pathfinder NNN999 Unknown Unknown
yellow Nissan Pathfinder JUH999 Unknown Unknown
black Nissan Pathfinder MHB999 Unknown Unknown
white Nissan Pathfinder UUI999 Unknown Unknown
silver Nissan Pathfinder GFD999 Unknown Unknown
red Toyota Corola AVF433 Unknown Unknown
blue Toyota Corola VAF433 Unknown Unknown
yellow Toyota Corola VVA433 Unknown Unknown
green Toyota Corola BVF433 Unknown Unknown
black Toyota Corola VBF433 Unknown Unknown
white Toyota Corola VVB433 Unknown Unknown
silver Toyota Corola GVF433 Unknown Unknown
red Toyota Landcruiser JTR567 Unknown Unknown
blue Toyota Landcruiser TJR567 Unknown Unknown
green Toyota Landcruiser TTJ567 Unknown Unknown
yellow Toyota Landcruiser RTR567 Fred Flintstone
black Toyota Landcruiser TRR567 Red Simons
white Toyota Landcruiser TTH567 Unknown Unknown
silver Toyota Landcruiser HTR567 Jamie Oliver
The cars are to be implemented with a Car class. The class should hold at least the following data:
make (string)
model (string)
registration number (string)
driver (Person)
The Car class should implement at least the following methods:
getMake(self) returns the make of the car
getModel(self) returns the model of the car
getRego(self) returns the registration number of the car
getDriver(self) returns the driver of the car
setDriver(self, driver) sets the driver of the car to driver (type Person)
The Car class will also need to implement methods to hire and return the car as well as indicate if it is able to be hired out.
The drivers are to be implemented with a Person class. The class should hold at least the following data:
firstName (string)
lastName (string)
The Person class should implement at least the following methods:
getFirstName(self) returns first name of person
getLastName(self) returns the last name of the person
setFirstName(self, name) sets the first name of the person to name
setLastName(self, name) sets the last name of the person to name
You may implement other methods as you deem necessary.
The initial data for the hire car company is to be read from the hireCar.txt file supplied. Your program should implement correct error handling so that the program does not crash if the file is not available, but give an acceptable, informative error message and gracefully close, not crash.
The program should implement a menu system that allows the following functionality:
List the cars by colour
List the cars by make
List the cars available
Hire out a car
Return a car
Add a car to the list
Delete a specific car from the list
Exit the program.
Your program should implement sufficient error control so that if the user enters an unexpected menu choice, the program will give an error message and represent the menu, not crash.
Your program should give an error message to the user if an illegal activity is attempted, such as:
attempting to hire a car that is currently hired
attempting to return a car that is not currently hired
attempting to delete a car that is currently hired
On exiting the program the data held in the car list should be written to a file. Your file handling code should also implement correct error control.
CHALLENGE TASK -> (To be undertaken after the other parts have been completed)
Implement a GUI class to run the program through a GUI. All the interaction with the user should be through the GUI, with the possible exception of getting new drivers names for hiring purposes. Your interface should implement buttons (from the buttonClass developed in class) to perform the following functions:
show the first car on the list,
show the last car on the list
step through the car list from first to last
step through the car list from last to first
add a car to the list
delete a car from the list
exit the program
Error message should be given to the user if they attempt any illegal activities, such as:
attempting to step off the end of the list (ie asking for the next car when the last one is displayed
attempting to step off the start of the list (ie asking for the previous car when the first one is displayed
attempting to hire a car that is currently hired
attempting to return a car that is not currently hired
attempting to delete a car that is currently hired
On exiting the GUI interface, you program should write the data held in the program to a file.
CARS LIST:
red Holden Barina ABC123 Unknown Unknown
blue Holden Barina ABD123 Unknown Unknown
green Holden Barina ABF123 Unknown Unknown
yellow Holden Barina ABH123 Unknown Unknown
black Holden Barina ABE123 Unknown Unknown
white Holden Barina ABJ123 Unknown Unknown
silver Holden Barina ABU123 Unknown Unknown
red Holden Commodore BCX344 Unknown Unknown
blue Holden Commodore XXD344 Unknown Unknown
green Holden Commodore BCH344 Unknown Unknown
yellow Holden Commodore BHD344 Unknown Unknown
black Holden Commodore HCD344 Unknown Unknown
white Holden Commodore BCO344 Unknown Unknown
silver Holden Commodore BCD344 Unknown Unknown
red Ford Fiesta ASD345 Unknown Unknown
blue Ford Fiesta ASD645 Unknown Unknown
green Ford Fiesta ASD365 Tom Jones
yellow Ford Fiesta ASD346 Unknown Unknown
black Ford Fiesta ASD845 Unknown Unknown
white Ford Fiesta ASD385 Unknown Unknown
silver Ford Fiesta ASD348 Sammy Davis
red Ford Falcon JRE987 Unknown Unknown
blue Ford Falcon TJE987 Unknown Unknown
green Ford Falcon TRJ987 Fred Nerke
yellow Ford Falcon BRE987 Unknown Unknown
black Ford Falcon TBE987 Unknown Unknown
white Ford Falcon TRB987 Unknown Unknown
silver Ford Falcon TGE987 Unknown Unknown
red Mazda Bravo MFE645 Buffy Summers
blue Mazda Bravo VME645 Unknown Unknown
green Mazda Bravo VFM645 Unknown Unknown
yellow Mazda Bravo NFE645 Skippy Kangaroo
black Mazda Bravo VNE645 Unknown Unknown
white Mazda Bravo VFN645 Unknown Unknown
silver Mazda Bravo KFE645 Unknown Unknown
red Mazda 323 ADV543 Unknown Unknown
blue Mazda 323 BAV543 Unknown Unknown
green Mazda 323 BDA543 Unknown Unknown
yellow Mazda 323 FFV543 Unknown Unknown
black Mazda 323 BDF543 Unknown Unknown
white Mazda 323 BFV543 Ricky Ponting
silver Mazda 323 JDV543 Unknown Unknown
red Nissan Tida MGE543 Unknown Unknown
blue Nissan Tida NGE543 Unknown Unknown
green Nissan Tida JGE543 Unknown Unknown
yellow Nissan Tida KGE543 Unknown Unknown
black Nissan Tida BKE543 Unknown Unknown
white Nissan Tida BKE543 Unknown Unknown
silver Nissan Tida BGL543 Unknown Unknown
red Nissan Pathfinder RRR999 Dick Smith
blue Nissan Pathfinder LLL999 Unknown Unknown
green Nissan Pathfinder NNN999 Unknown Unknown
yellow Nissan Pathfinder JUH999 Unknown Unknown
black Nissan Pathfinder MHB999 Unknown Unknown
white Nissan Pathfinder UUI999 Unknown Unknown
silver Nissan Pathfinder GFD999 Unknown Unknown
red Toyota Corola AVF433 Unknown Unknown
blue Toyota Corola VAF433 Unknown Unknown
yellow Toyota Corola VVA433 Unknown Unknown
green Toyota Corola BVF433 Unknown Unknown
black Toyota Corola VBF433 Unknown Unknown
white Toyota Corola VVB433 Unknown Unknown
silver Toyota Corola GVF433 Unknown Unknown
red Toyota Landcruiser JTR567 Unknown Unknown
blue Toyota Landcruiser TJR567 Unknown Unknown
green Toyota Landcruiser TTJ567 Unknown Unknown
yellow Toyota Landcruiser RTR567 Fred Flintstone
black Toyota Landcruiser TRR567 Red Simons
white Toyota Landcruiser TTH567 Unknown Unknown
silver Toyota Landcruiser HTR567 Jamie Oliver