Boolean Expression

Hey guys! I am in cs124 in college so this assignment already had a template, thats why there are comments on there. Basically (i know its religious, im at a religious school haha) i am trying to get an output to say whether or not the user is a full "tithe payer" based on their input. If their input for tithing is less than 10% of their income, its supposed to give that scripture verse, if its above 10%, it will output "you are a full tithe payer". my problem is every time i run the program, it outputs "you are a full tithe oayer" even if my input is under 10%......any hints you guys can give me? Thanks so much!!!


#include <iostream>
using namespace std;

bool isFullTithePayer(float income, float tithe)
{


// remove this line of code and make it return true if the
// user is a full tithe payer and false if he needs to repent.
return true;
}

/**********************************************************************
* Main will call isFullTithePayer() and display an appropriate message
* to the user based on the results
***********************************************************************/
int main()
{
float income;
float tithe;

// prompt user for income
cout << "Income: ";
cin >> income;

// prompt user for tithe
cout << "Tithe: ";
cin >> tithe;

// give the user his tithing report
if (isFullTithePayer(income, tithe))
cout << "You are a full tithe payer.\n";
else
cout << "Will a man rob God? Yet ye have robbed me.\n"
<< "But ye say, Wherein have we robbed thee?\n"
<< "In tithes and offerings. Malachi 3:8\n";

return 0;
Did you write the code for this function? What you've posted here so far will always return true.

1
2
3
4
5
6
7
8
bool isFullTithePayer(float income, float tithe)
{


// remove this line of code and make it return true if the
// user is a full tithe payer and false if he needs to repent.
return true;
}
Topic archived. No new replies allowed.