User Profile
Collapse
-
I pass the amount of the loan. We'll say 5700. The amount of interest, we'll say 12 . And the amount of total payments, we'll say 36.... -
incorrect answer
I have been working on this program for a few days now, and I am at a loss as to what is wrong. I am new to c++, so I am sure that it must be something simple that I am missing, but I can not pin point it. Below is my code, and no matter what I input it gives me the same answer: $1.#INF. All I need for it to do is calculate the monthly payments .
[CODE=cpp]#include <iostream>
using namespace std ;
... -
alright, I have taken your advice, and here is the revised code. I am getting an error message. It says [Warning] in function 'double: I have no idea why it is saying this.
#include <iostream>
using namespace std ;
//function prototype
double payment(double balance, double AIR, int num_of_pay);
//funciton prototyp
double power (int num_of_pay, double AIR, float number);...Leave a comment:
-
I see what you are saying about there being no multiplication, and so i changed the while loop to ;for (i=0; i< abs (num_of_pay); i++) result *= number;
I don not know what you mean about me not calling my functions. I was wondering if you could elaborate for me. Thank youLeave a comment:
-
here is the code that I have revised to. no matter what my input it always gives me the same answer. I am not sure what I am doing wrong.
#include <iostream>
using namespace std ;
//function prototype
double payment(double balance, double AIR, int num_of_pay);
//funciton prototyp
double power (int num_of_pay, double AIR, float number);
int main ()
{
double month_pay;...Leave a comment:
-
Alright, now that i fixed this, I am still coming up with the same answer no matter what data I input. I need for this function to be able to perform a negative exponentiation for a monthly payment calculator.Leave a comment:
-
negative exponent
I am trying to create a function that computes a negative exponent. This is what I have, but it is not returning the proper answer. I was wondering if anyone can see where I have gone wrong. Thanks
//This function raises 1+AIR to a negative n power
float power (int num_of_pay, float number)
{
float result;
int i;
double AIR;
number = (1 + AIR);... -
binomial coefficients
I have worked out all the bugs on my program. It is compiled and it actually runs. The problem I am having is it is not giving me the right answers. I know it must be something in my equation, but after looking at it for hours, I can't seem to locate the problem. Here is my equation:
[code=c]
denominator = 1 ; // initial value
numerator = 1 ;
for (i = 1 ; i <= k+1 ; i = i+1 )
{... -
I appreciate the help. It did work, and my program can now compile. I have got the program to where it returns a value when n is less than k. However if it is not I get an error from microsoft and the program shuts down. I have been going over it for hours and just can't seem to find the problem. Thanks
int binomial (int n, int k)
/* Computes the binomial coefficient nCk */
/*?????????????? ??????????????? ?????????...Leave a comment:
-
Can't get this program to compile
I am trying to get this program to compile and it is not working. I am new to c ++ and frustrated beyond belief. Please help.
#include "stdafx.h"
#include <iostream>
using namespace std ;
int binomial(int n, int k) ; // function prototype
int main(int argc, char**argp)
{
int n, k ; // parameters for the binomial number...
No activity results to display
Show More
Leave a comment: