You work in an insurance company, you have installed trackers into several of your customers’ cars to monitor their driving and offer a discount bonus if they are ‘good’ drivers.  The data collected show the average acceleration per trip for the last ten trips for five sample drivers. The rules state that if the total average acceleration for the past ten trips is more than 5 metres per second per second OR any trip has an average of 6 metres per second per second or more, then no discount should be applied to the customer.  The collected data are shown below and captured in a two-dimensional array called acceleration. Write a C function called bonusCheck that takes the 2D array and the driver number (their index in the array of acceleration data eg. Driver 1 = {2, 2, 2, 3, 4, 4, 3, 3, 3, 2}) as parameters and returns 1 to apply bonus and 0 for no bonus.    For example: Test Result int acceleration [5][10] = {{3, 1, 3, 4, 6, 7, 3, 2, 5, 3},{2, 2, 2, 3, 4, 4, 3, 3, 3, 2},{5, 6, 7, 6, 5, 3, 3, 3, 3, 3},{3, 3, 3, 3, 4, 4, 3, 2, 1, 3},{2, 3, 4, 6, 6, 2, 5, 1, 3, 3}}; printf("%d", bonusCheck(acceleration,1)); 1 int acceleration [5][10] = {{3, 1, 3, 4, 6, 7, 3, 2, 5, 3},{2, 2, 2, 3, 4, 4, 3, 3, 3, 2},{5, 6, 7, 6, 5, 3, 3, 3, 3, 3},{3, 3, 3, 3, 4, 4, 3, 2, 1, 3},{2, 3, 4, 6, 6, 2, 5, 1, 3, 3}}; printf("%d", bonusCheck(acceleration,2)); 0

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

You work in an insurance company, you have installed trackers into several of your customers’ cars to monitor their driving and offer a discount bonus if they are ‘good’ drivers.  The data collected show the average acceleration per trip for the last ten trips for five sample drivers.

The rules state that if the total average acceleration for the past ten trips is more than 5 metres per second per second OR any trip has an average of 6 metres per second per second or more, then no discount should be applied to the customer. 

The collected data are shown below and captured in a two-dimensional array called acceleration.

Write a C function called bonusCheck that takes the 2D array and the driver number (their index in the array of acceleration data eg. Driver 1 = {2, 2, 2, 3, 4, 4, 3, 3, 3, 2}) as parameters and returns 1 to apply bonus and 0 for no bonus. 

 

For example:

Test Result
int acceleration [5][10] = {{3, 1, 3, 4, 6, 7, 3, 2, 5, 3},{2, 2, 2, 3, 4, 4, 3, 3, 3, 2},{5, 6, 7, 6, 5, 3, 3, 3, 3, 3},{3, 3, 3, 3, 4, 4, 3, 2, 1, 3},{2, 3, 4, 6, 6, 2, 5, 1, 3, 3}}; printf("%d", bonusCheck(acceleration,1));

1

int acceleration [5][10] = {{3, 1, 3, 4, 6, 7, 3, 2, 5, 3},{2, 2, 2, 3, 4, 4, 3, 3, 3, 2},{5, 6, 7, 6, 5, 3, 3, 3, 3, 3},{3, 3, 3, 3, 4, 4, 3, 2, 1, 3},{2, 3, 4, 6, 6, 2, 5, 1, 3, 3}}; printf("%d", bonusCheck(acceleration,2)); 0
   
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY