Skip to content

Pr030304/MasteringWeb3.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MasteringWeb3.0

MasteringWeb3.0 recruitment task The task code was very interesting . Here’s how my code works!

I made a car class and defined the required attributes. But I made the speed attribute another class with its 3 co-ordinate components. 
Now I took user input the co-ordinates and the speed with it’s 3 co-ordinates for the two cars separately. 
Then I asked the user what car’s acceleration/braking do they want to modify, and accordingly invoked the acceleration/braking function.

the acceleration/braking function updates all the three co-ordinates of the speed function. I calculated the time taken for them to collide, and then invoked the move function. the move function updates all the three co-ordinates of the car, and the time is calculated by distance/absolute value of relative speed. I created structure speed to contain x y z components of speed. Due to time constraint we were not able to convert C file to Cpp correctly so we have uploaded both files.code of C file is running better.

About

MasteringWeb3.0 recruitment task

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published