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

Explain the signature of each function. Identify the 2 preconditions and postcon

ID: 3549378 • Letter: E

Question

Explain the signature of each function.

Identify the 2 preconditions and postcondition of the driver program:


{ int ?ndAccount(int id); double getBalance(int account);

double addFunds(int account, double amount); double addInterest(int account, double rate); }


int main(int argc, char **argv)

{

const int myID = 120;

int account = 0;

double balance = 0;

const double irate = .003;

double weekpaycheck = 512.50;

int i = 0;

account = findAccount(myID);

for(i = 0; i < 52; i++)

{

balance = getBalance(account);

balance += addFunds(account, weekpaycheck);

balance += addInterest(account, irate);

}//End year loop

c

Explanation / Answer

Pre-conditioning:


const int myID = 120;

int account = 0;

double balance = 0;

const double irate = .003;

double weekpaycheck = 512.50;

int i = 0;


post conditioning:


balance = getBalance(account);

balance += addFunds(account, weekpaycheck);

balance += addInterest(account, irate);



Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote