Question 1: Write the header and signature for the following function. Also writ
ID: 639151 • Letter: Q
Question
Question 1:Write the header and signature for the following function. Also write the two forms of its prototype.
double Print_Message(double balance, double limit)
{
if (limit > 0)
{
cout<<"Your Balance is $"<<balance<<endl;
cout<<"Your have money. Proceed with your transaction ";
}
else
{
cout<<"Your Balance is $"<<balance<<endl;
cout<<"Your transaction has been cancelled ";
}
return balance
}
int main()
{
double balance = 99.99, limit = 2000.22;
cout<<"Balacne and Limt have the following values before Print_Message is called"<<endl;
cout<<"balance= "<<balance<<" and limit = "<<limt<<endl;
Print_Message(balance, limit);
cout<<"a and b have the following values after swap is called"<<endl;
cout<<"Balance = "<<balance<<" and Limit = "<<limit<<endl;
return 0;
}
Explanation / Answer
header is calculating bank balance
The function name and the parameter list together constitute the function signature.
Print_Message(double balance, double limit)
// FUNCTION HEADER
//Method: Print_Message
//Description: print message of balance and limit.
//Input: double balance and double limit.
//Return: double
// FUNCTION SIGNATURE
double Print_Message(double balance, double limit)
two forms of prototype is
1. double Print_Message(double balance, double limit)
2. double Print_Message(double , double )
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.