Click here to Skip to main content
15,072,209 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Write a program for car drive.

Following condition should meet in the program.
1. Accelerator should be main thread.
2. car can drive with maximum speed of 5000 KM on top gear.
below are each speed levels for each gear.
a. 0-1000 KM 1st gear
b. 1000-2000 2nd gear
c. 2000-3000 3rd gear
d. 3000-4000 4th gear
e. 4000-5000 5th gear
f. Revers 6th gear
3. Three speed breaks at each speed levels 4100,4200,4300 respectively after 5th Gear shifted, so here break should be applied to reduce the speed and gear should be shifted to 1st gear.
4. In 4th Level car should reach maximum speed then apply break to park the car using reverse gear.
5. Each gear shift clutch should be used as required.
6. Total speed driven should be calculated and shown.
5. 9 threads should be used.
6. logger or sysout should be used to show each threads activity in console.

What I have tried:

Has anyone please help me out with the below code please?
Posted
Updated 2-May-21 3:39am

1 solution

You have not explained what help you need. If you are asking someone to write the program for you, I am afraid that is not going to happen. You could start by reading How to Write Code to Solve a Problem, A Beginner's Guide[^] and perhaps go to The Java™ Tutorials[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900