Ron's Brain

rm -rf pants
3 total messages. For real this time.
Protactinium
09/16/2004 @ 22:35:10 EDT

/*The purpose of this program is to determine wether or not an applicant
*will be accepted to use a credit card.
*Inputs: Annual Income
* Total Assets
* Total Liabilities
*
*Outputs: Approval or Denial
***********************************************************************/
#include <iostream>
#include <string>
using namespace std;

int main()
{
cout << "\nEnter Applicant's Annual Income : "; //Applicant's Annual Income
int Income;
cin >> Income;
cout << "\nEnter Applicant's Total Assests : "; //Applicant's Total Assets
int Assets;
cin >> Assets;
cout << "\nEnter Applicant's Total Liabilites : "; //Applicant's Total Liabilities
int Liabilities;
cin >> Liabilities;
if (((Income >= 25000) || (Assets >=100000)) && (Liabilities < 50000)) {
cout << "\nCongratulations! You were approved for this credit card."; //Approved
cout << "\n";
}
else {
cout << "\nI'm sorry. You were not approved for this credit card."; //Rejected
cout << "\n";
}
return (0);
}


w00t!

Hydrogen
09/20/2004 @ 20:31:34 EDT

So, why include the string library?

Hydrogen
09/27/2004 @ 22:13:48 EDT

A suggestion would be to use macros to define the approval criteria. Don't know if you've done anything like that in class, but...

#define MIN_INCOME 25000
#define MIN_ASSETS 100000
#define MAX_LIABILITIES 50000

.
.
.

if(((Income >= MIN_INCOME) || (Assets >= MIN_ASSESS)) && (Liabilities < MAX_LIABILITIES)) {
.
.
.
}

Just a thought.

Recent users
Logged on users that have pretended to enjoy this site within the last five minutes
There are no logged on users. How sad!