Posts tagged "duration"

What is wrong with these pointers (C programming)?

include
#include
#define TAX_RATE 1.25
#define UTILITY_COST 300.0
#define INSURANCE_COST 550.0

void input(float*, float*, float*);
void calc(float, float, float, float, float, float, float, float);
float calcDplomo(float, float, float, float*, float*, float*, float*, float*);
void output(float, float, float, float, float, float, float, float);

int main(void)

{

float sellp;
float anir;
float loand;
float downp;
float amtl;
float mortg;
float propt;
float mtot;

input(&sellp, &anir, &loand);

calc(sellp, anir, loand, downp, amtl, mortg, propt, mtot);

output(sellp, anir, loand, downp, amtl, mortg, propt, mtot);

return 0;
}

void input(float* sellp, float* anir, float* loand)

{

printf(“\n\t\t Brian’s Mortgage Calculation Program\n”);

printf(“\nEnter the property’s selling price: \n”);
scanf(“%f”,sellp);

printf(“\nEnter the annual rate of interest: \n”);
scanf(“%f”,anir);

printf(“\nEnter the duration (years) of the loan: \n”);
scanf(“%f”,loand);

return;
}

void calc(float sellp, float anir, float loand, float downp, float amtl, float mortg, float propt, float mtot)
{

calcDplomo(sellp, anir, loand, &downp, &amtl, &mortg, &propt, &mtot);

return;
}

float calcDplomo(float sellp, float anir, float loand, float* downp, float* amtl, float* mortg, float* propt, float* mtot)
{
float cdown = .2;
float mins;
*propt = sellp * (TAX_RATE/100)/12;
mins = INSURANCE_COST/12;
*mtot = *mortg + UTILITY_COST + *propt + mins;
*downp = sellp * cdown;
*amtl = sellp – *downp;
*mortg = *amtl * anir/12*(1+anir/12) * loand *12/(1+anir/12) * loand *12-1;

return mins;
}

void output(float sellp, float anir, float loand, float downp, float amtl, float mortg, float propt, float mtot)

{
printf(“\nMONTHLY COST OF HOUSE\n”);

printf(“\nSELLING PRICE $ %9.2f”,sellp);
printf(“\nDOWN PAYMENT %9.2f”,downp);
printf(“\nAMOUNT OF LOAN %9.2f”,amtl);
printf(“\nINTEREST RATE %9.1f%%”,anir);
printf(“\nTAX RATE %9.1f%%”,TAX_RATE);
printf(“\nDURATION OF LOAN (YEARS) %9.0f\n”,loand);

printf(“\nMONTHLY PAYMENT\n”);

printf(“\nMORTGAGE %9.2f”,mortg);
printf(“\nUTILITIES %9.2f”,UTILITY_COST);
printf(“\nPROPERTY TAXES %9.2f”,propt);
printf(“\nUTILITIES %9.2f\n”,INSURANCE_COST);

printf(” __________”);
printf(” $ %9.2f\n”,mtot);

return;

}

Trial run:

Brian’s Mortgage Calculation Program

Enter the property’s selling price:
600000

Enter the annual rate of interest:
2.2

Enter the duration (years) of the loan:
30

MONTHLY COST OF HOUSE

SELLING PRICE $ 600000.00
DOWN PAYMENT -107374176.00
AMOUNT OF LOAN -107374176.00
INTEREST RATE 2.2%
TAX RATE 1.3%
DURATION OF LOAN (YEARS) 30

MONTHLY PAYMENT

MORTGAGE -107374176.00
UTILITIES 300.00
PROPERTY TAXES -107374176.00
UTILITIES 550.00
__________
$ -107374176.00
Press any key to continue

I know it has to do with the function call in void calc calcDplomo(sellp, anir, loand, &downp, &amtl, &mortg, &propt, &mtot); But how do I fix it?

1 comment - What do you think?
Posted by jedwan - May 18, 2011 at 10:38 am

Categories: Mortgage   Tags: , , , , , , , , ,

Company forcing change to payment plan

Hi, Last year I was a member of Zipcar in NY. Under this membership, in June my brother who was not a member drove a car under my account & was involved in an accident

Read more...

Be the first to comment - What do you think?
Posted by jedwan - August 26, 2010 at 12:57 am

Categories: Mortgage   Tags: , , , , , , , , , , , , , ,

Can you sublet against your roommate’s will?

I know two people who are on a lease -- Friend and EvilOne.

Read more...

Be the first to comment - What do you think?
Posted by jedwan - July 20, 2010 at 5:19 pm

Categories: Mortgage   Tags: , , , , , , , , , , , , , , , , , ,

H1 to H4 to H1 Visa portability

Hi, I got my H1 Visa under quota for FY 2006.

Read more...

Be the first to comment - What do you think?
Posted by jedwan - April 7, 2010 at 2:53 pm

Categories: Mortgage   Tags: , , , , , , , , , , , , , , , , , , , , , , ,

Overnight guest refuses to leave months later

I live in a San Francisco studio with a lease that prohibits other people from residing with me. I have a guest that has been staying with me for 7 months

Read more...

Be the first to comment - What do you think?
Posted by jedwan - March 2, 2010 at 8:18 am

Categories: Mortgage   Tags: , , , , , , , , , , , ,

Continuation of benefits if WC is from old employer

If an employee sporadically misses work and then ultimately goes on WC related to an old employers injury and claim, do I need to continue paying the employee their salary and benefits while they are not performing any work for me? If I continued their salary and benefits expecting a short duration, which was not the case, do I have any recourse from the old employer or their wc carrier to reclaim any of those expenditures

Read more...

Be the first to comment - What do you think?
Posted by jedwan - February 27, 2010 at 6:05 pm

Categories: Mortgage   Tags: , , , , , , , , , , , , , , , , ,