Posts Tagged ‘interest rate’

Help with credit card interest calculating program for C++(urgent!)?

Could anyone please help me with some of the errors in this code? Here is the assignment:

Complete programming project 6 on page 243.

Read the description carefully, insure that you allow the user a choice to run the program or exit.

The function prototype is:

double interest (double initBalance, double rate, int months);

Your initial output to the user should be something like this:

Credit card interest
Enter: initial balance, monthly interest rate as
a decimal fraction, e.g. for 1.5% per month write 0.015
and the number of months the bill has run.
I will give you the interest that has accumulated.
100 .1 2

Interest accumulated = .00
Y or y repeats, any other character quits
y

Credit card interest
Enter: initial balance, monthly interest rate as
a decimal fraction, e.g. for 1.5% per month write 0.015
and months the bill has run.
I will give you the interest that has accumulated.
100 .1 3

Interest accumulated = .10
Y or y repeats, any other character quits
n

My code will come in the posts after this.

//File Name: workshop4.zip
//Author: Celest Guardian
//Email Adress: cg26@students.uwf.edu
//Workshop Number: 4
//Description: A C++ program used to calculate the interest on a credit card balance.
//Last Edited: October 10, 2008

#include <iostream>
using namespace std;

double interest (double initBalance, double rate, int months);
//Caluclates the interest accumulated from a credit card balance
//from the intitial balance, interest rate, and number of months the user has had the loan.

int main ( )
{
double initBalance, initAccumulated, rate;
int months;
char quit;

{
cout << "\nCredit card interest";
cout << "\nEnter: initial balance, monthly interest rate as";
cout << "\na decimal fraction, e.g. for 1.5% per month write 0.015";
cout << "\nand the number of months the bill has run.";
cout << "\nI will give you the interest that has accumulated.";

cin >> initBalance; "\t";
cin >> rate; "\t";
cin >> months; "\t";

initAccumulated = interest(initBalance, rate, months);

cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);

cout << "\nInterest accumulated = $" << initAccumulated;

}

return 0;
}

double interest (double initBalance, double rate, int months)
{
for (int i=0; i < months; i++)
{
double interest = initBalance * rate;

double initBalance = initBalance + interest;
}
initAccumulated = initAccumulated + interest;
return (initBalance);
}
Here is a the main error from the compiler:

error: ‘initAccumulated’ was not declared in this scope

I know I need to declare this but when I do it causes even more errors. Also, there is a logic error because the Accumulated interest is only equal to the value entered for the balance. :( Please help!
Dear Charlie,

*sigh* Because this much will get me an F. :( My teacher just assigned it so and it is due tonight. It is not going very well and I don’t know anyone to ask for help.
Thanks, Mr. C but that one you have to pay for and this project is due at 11:30 central time so I really dout that I would be able to get help in time. :(


Related Blogs

Is it better to transfer credit card balances to 0% card or get personal loan to pay them off?

I have about ,000 in credit card debt and was wondering if it would be better for my credit to get a 0% transfer card and transfer my balances or get a personal loan to pay off the cards. I am a recent law school graduate and will be able to pay off the credit card or loan within the next 6 months. Thanks
Thanks for the responses! The 0% balance transfer option seemed the better choice to me but for some reason I feel like I’ve always heard that it can really hurt your credit rating if you pay off cards by getting a new card (which is why I considered the personal loan option).

The reason I feel forced to choose one or the other is that I was recently late in making one of my card payments (with the majority of debt on it) and my interest rate was increased to 22%. As I am still searching for a job and have student loan payments coming up, I just can’t afford to make the high minimum payments right now.


Related Blogs

My 0% balance transfer card is about to expire. How long should I wait to apply for another 0% card?

Currently, I have 6 credit cards: Nordstrom, Citibank, Amax Blue, Nordstrom, Capitalone, HSBC.

Nordstrom and Citibank: everyday purchase and pay off statement balance every month on time.

Capitalone: card for cash advance since they mail me checks every month, I just deposit most of the balance into my bank account and pay them off statement balance every month as well.

Amax Blue: 0% intro interest expired Jan 2008. Since then, I rarely use this card. I have under charges monthly, and pay off every month on time.

HSBC: my 0% interest rate is expiring in June, just got this card in Dec 2007. I carry a high balance all 5 months and pay on time, never late, and will pay off statement balance at the last month of 0% offer.

Here’s the question: When should I wait to apply for another 0% credit card? I’m planning on using husband and my credit back and forth to apply for 0% card. How long should each person wait to apply for one? When should I cancel after the 0% expires?


Related Blogs

How to combine 3 Credit Cards Onto 1 Credit Card?

Want to combine 3 credit cards into 1 credit card (less than 2700 total) Anyone know of a credit card with 0 Balance transfer at 0% interest? Also who charges the balance transfer fee? The credit card im payin off or the new cc? tryin to save money Please help….thanks for input.
I was planning on opening another card with a better interest rate….like 0 for 6 months….will this hurt my credit score….like to keep it where its at…above 750


Related Blogs

Can I buy a car using my credit card?

I thinking about buying a car 20grand out the door max. I dont want a lecture on credit please.

1. One is to buy car and put it on my credit card. Can this be done? Do dealership take credit cards?

2. I have really good credit and get these blank 0% APR until, lets say July 2007 all the time. I can use these for purchase or deposit it in my bank account but it will be treated as a cash advance and has a max fee of . So if I write a check for ,000, there will be a fee of . So I was thinking of writing the check to the dealership or myself. When July 07 comes and interest rate kick in, I would transfer that balance to another credit card with 0% offer. So overall I pay 0% interest and all I lose is about in fees, and my car will probably be paid off by the time the promotion period ends.


Related Blogs

Should I use a credit card with a 0% introductory APR for 12 months to pay for a year’s worth of car payments?

Hello all, my car payment is 5 per month, but I always pay 0 per month or 00 a year. The interest rate on the car loan is 6.24%. I have an excellent credit score and I know that there are lots of credit cards with 0% for 12 months. I figure I could pay ,000 of my loan with a 0% card and save myself upwards of 0 on interest this year. I could put the 0/month that I would have paid into my liquid money market account for the year and earn another or so for a total savings of about 0. Then before the interest kicks in on the card after 11 months or so, I could pay it off out of my money market account. Would this be wise? Is there anything I am not thinking of here? Thanks for any comments


Related Blogs

Getting rid of high interest Credit Card or the Card with lower prom rate that expires soon.?

I have 2 Credit Card (CC), one has APR 0f 0% till Nov 2007 (teaser rate) after the the interest rate goes upto 12% and the other loan I have is for larger $$$ amount with 16% APR … I have got some saving, should I try to pay off the 0% APR by Nov, which if I try I can before my 12% kicks in .. or should I put my savings toward the high interest loan … which is going to take some time before I can pay it off even if I put in my saving there …


Related Blogs

Is my 0% rate on my Washington Mutual credit card still good?

I have a credit card with Washington Mutual and it has a 0% interest rate until the promo rate expires next April. Now that it has been bought out by JP Morgan Chase, can they change my account to a higher interest rate?


Related Blogs

0% interest rate, transfer money into bank account from it, they consider that a balance transfer correct?

I had a 0% interest rate on my credit card and if I remember right they counted it as a balance transfer and didn’t have to pay it back for 6 months. Am I right? They don’t charge it as a cash advance right? I have some stuff i have to pay at the end of the year and was thinking about getting the 0% again


Related Blogs

What do credit card companies mean when they say "prime 0.9% interest rate" for example.?

Any accountants or anything out there?

What is a "prime" rate? How good is 0.9%? Is that low very common? "interest rate" means more money added every month?

Thank you.


Related Blogs

Powered by Yahoo! Answers