Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Umor Collins

Greenhorn
+ Follow
since Mar 05, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Umor Collins

I need to create two classes, one called car (this is the actual car object) and one called carlist (this is an array of cars which are for sale). I of course also need to create an additional driver class for the program (this will contain the main method which will create objects and call their methods, and I need to use the keyboard class to get input from the user).
The program should be capable of providing the following user experience:
ACME Used Car Dealers
1. Purchase car
2. Display cars for sale
3. Sell car
Enter option: 1
PURCHASE CAR
MAKE: Ford
Model: Escort
Year: 2001
Miles: 3400
Color: White
Purchase price: 1500
Sale price: 2495
1. Purchase car
2. Display cars for sale
3. Sell car
Enter option: 2
CARS FOR SALE
No Make Model Year Miles Color Price
1 Ford Escort 2001 3400 White 2495
2 Saab 93 2000 56000 Black 4999
1. Purchase car
2. Display cars for sale
3. Sell car
Enter option: 3
SELL A CAR
Which car: 1
What price: 2395
Sold a White Ford Escort 2001
You just made us $895 profit

BTW, each car object should store (at a minimum) the following information:
-make
-model
-year
-miles
-color
-purchase price
-for sale price
-sold flag
The carlist object will be an array of cars and a pointer to the next free location in the array for the next car to go in
I would appreciate any sort of help
18 years ago