Question: Description In this program, you will continue writing code for the average acceleration. Review of requirements for average acceleration: Average acceleration is defined as the
Description
In this program, you will continue writing code for the average acceleration.
Review of requirements for average acceleration:
Average acceleration is defined as the change of velocity divided by the time taken to make the change.
Start with your program from last class. Make sure that you make any updates that are given from the grading. You can lose points again.
Part Enum:
Create an Enum called AccelerationType
Values are UNIFORM, NONUNIFORM, AVERAGE, INSTANTANEOUS
Part Reading and writing to a File:
Let's create a method called writeAccelerationToFile
parameters: double acceleration
return none
the file that we are going to write to is called: acclerationHistory.dat
write one acceleration per line.
Let's create a method called readAccelreatonFromFile
no parameters
return none
the file that we are going to read from is called: acclerationHistory.dat
In this method print out the accelerations saved in the file. See the examples below for formatting of the output
In the main method, in the loop, ask the following question:
System.out.printEnter to save the acceleration history or Enter anything else to continue ;
if the user enters call the writeAccelerationToFile
In the main method, after the loop, ask the following question:
System.out.printEnter to print the acceleration history or Enter anything else to continue ;
if the user enters call the readAccelerationFromFile
Run the program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
