Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 2.05 KB

README.md

File metadata and controls

26 lines (22 loc) · 2.05 KB

Car Trip Analysis

This program reads input data from a file and analyzes the vertical displacement of a car due to bumps on the road. The program provides two options for analysis: mass analysis and velocity analysis.

Functions:

  • ReadData(): reads input data from a file
  • CalculateDisplacement(): calculates the vertical displacement of the car due to a bump on the road
  • CarTripDisplacement(): populates an array with the vertical displacement of the car for each bump on the road
  • WriteData(): writes output data to a file
  • MassEffectAnalysis(): analyzes the effect of varying mass on the displacement of the car
  • VelocityEffectAnalysis(): analyzes the effect of varying velocity on the displacement of the car
  • PrintData(): prints the contents of a file to the output console

Program Flow:

  1. The program reads input data from a file using the ReadData() function
  2. The program calculates the vertical displacement of the car for each bump on the road using the CarTripDisplacement() function
  3. The program writes output data to a file using the WriteData() function
  4. The program provides the user with a menu to select between mass analysis and velocity analysis
  5. If mass analysis is selected, the program analyzes the effect of varying mass on the displacement of the car using the MassEffectAnalysis() function and prints the results to the output console using the PrintData() function
  6. If velocity analysis is selected, the program analyzes the effect of varying velocity on the displacement of the car using the VelocityEffectAnalysis() function and prints the results to the output console using the PrintData() function
  7. The program prompts the user to exit or return to the menu