Answer:
void updateCredit(float credit){
if credit < 0.0
credit = 0.0;
}
Step-by-step explanation:
I am going to write a C function for this.
The input is your credit value, and it has just a conditional to verify if it is not negative.
void updateCredit(float credit){
if credit < 0.0
credit = 0.0;
}