Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part 5 Coding (30 points, 15 points each) 1. The decision table below shows fine

ID: 3590778 • Letter: P

Question

Part 5 Coding (30 points, 15 points each) 1. The decision table below shows fines imposed for speeding violations. Write a function named get_speeding fine that computes and returns the correct fine based on the speed. The speed is a number. The fine may have digits after the decimal point takes in the speed in mph (mile per hour), whole Speed (sph) Fine (s) 65 or less 66-70 71-75 76-80 over 80 15.50 30.50 75.50 100.50 2. Write a driver program, which prompts the user to enter the speed in mph, scans in the value of speed, and then calls the function get speeding fine. Your program should display the values of the speed and the fine before stopping. No comments are needed Page 4

Explanation / Answer

Hi,
I am implementing the driver program only as requested, i have added comments to help you understand.

#include <iostream>

using namespace std;
int get_speeding_fine(int speed)
{
/* given not required */
}
int main()
{
int speed;//variable to store speed
cout << "please enter the speed in mph" << endl;//prompting for input
cin>>speed;//scanning in the entered speed
cout<<"your speed is:"<<speed<<" and fine is "<<get_speeding_fine(speed)<<endl;//displaying speed and fine value by calling the function

return 0;
}
Thumbs up if this was helpful, otherwise let me know in comments