Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Develop the following template into an embedded C program. / Global variables here- avoid declaring too many globals unnecessarily as it is not considered

image text in transcribed

4. Develop the following template into an embedded C program. / Global variables here- avoid declaring too many globals unnecessarily as it is not considered a good programming practice. ' nt creditRatingAlice 750; Il 0 represents "defaulted" and 1 represents paid" for the payment history int monthlyPaymentHistoryAlice 24] 1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1] void main (void) Imain), while looping endlessly, sets a global flag creditStatus to the value returned by the function II rewardsOrAlarm). Function called when Alice makes a monthly payment or defaults on the monthly payment. Returns nothing, updates global variable creditRatingAlice. 7 void updateCrediRatingAlice (int opcode,0 if default, 1 if paid */) { Il each monthly payment increments rating by 10 points all the way up to 800 Il every default decrements rating by 10 points down to 700 Function that raises an alarm when Alice's rating is 700 for 2 consecutive months, Returns 0 if alarm, 1 if reward. or rewards her if she has maintained a rating of 800 for 2 consecutive months. *Reads montlyPaymentHistoryAlice for input. Page 2 of 4 int rewardsOrAlarm 0 Il Read next value in monthlyPaymentHistoryAlice. Note that this function needs to keep track of the Il last array element accessed so that when it reaches the last it can rewind to the first in a round Il robin fashion to read a value from the monthlyPaymentHistoryAlice array forever. Il Pass the read value in monthlyPaymentHistoryAlice to function updateCreditRatingAlice int x) l/ Return reward/alarm value

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

convert binary 10100100 to decimal. show work

Answered: 1 week ago

Question

5. Understand how cultural values influence conflict behavior.

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago