Design and Implement (in C) the following: (1) Create four functions: int whole_part (float value) This function
Fantastic news! We've Found the answer you've been seeking!
Question:
- Design and Implement (in C) the following: (1) Create four functions: int whole_part (float value) This function takes the value (in float data type) as an argument and returns the whole part (or integer part) of the value. float velocity_mps (float velocity) It takes velocity (in float data type) in km/h as an argument and returns its equivalent velocity in m/s. float Impact_force (float mass, float velocity_mps, float stopping_distance) It takes the mass (in kg), velocity (in m/s) and stopping_distance (in m) as arguments and returns the resulting force of impact (recall the formula provided in Workshop 1). CSP2151 A1 Workshop 2 Sem1, 2022 3 (2) Application scenario: You are required to develop a program that displays a Menu that allows the user to navigate through and execute the following options: 1. Covert a floating-point value to an integer 2. Convert a velocity value in km/h to its equivalent value in m/s 3. calculate impact force (for an array of velocity). 4. Exit. The program loops to display the menu options, waiting for the users response. When the user entered a number between 1 and 4, the program will execute the related options (if a number other than 1 through to 4, an error message will be displayed).
Posted Date: