NO

Author Topic: What do these errors mean?  (Read 2193 times)

dnasty54

  • Guest
What do these errors mean?
« on: October 01, 2014, 02:31:43 AM »
/*
* Monthly car payment
*/

#include <stdio.h>  /* printf, scanf definitions */
#include <math.h>

int
   main (void)
{
   double down_payment_price; /* input - down payment price */
   double purchase_price; /*  input - purchase price */
       double n; /* input - total number of payments */
   double annaual_interest_rate; /* input - annaual interest rate */
   double total_number_of_payments; /* input - total number of payments */
   double monthly_car_payment; /* output- monthly payment */
   double p; /* output- principal */
   double I; /* output - monthly interest rate */

   /* get the down payment of car */
   printf("enter down payment price> ");
   scanf("%lf", down_payment_price);

   /* get purchase price */
   printf(" enter purchase price> ");
   scanf("%lf", purchase_price);

   /* get total number of payments */
   printf(" enter total number of payments> ");
   scanf("%lf", n);

   /* get annaual interest rate */
   printf(" enter annaual interest rate> ");
   scanf("%lf", annaual_interest_rate);

   /* get the total number of payments */
   printf(" the total number of payments> ");
   scanf("%lf", total_number_of_payments);

      /* calculate amount borrowed */
   p = purchase_price - down_payment_price;

   /* calculate monthly interest rate */
   I = annaual_interest_rate /2

   /* calculate monthly car payment */
   monthly_car_payment = 1-(1+I)^-n/I*p

   /* display the monthly car payment */
   printf("\n the monthly car payment is %.f", monthly_car_payment);

      return (0)
}


C:\Users\student\Documents\monthly car payment.c(47): error #2001: Syntax error; found 'monthly_car_payment' expecting ';'.
C:\Users\student\Documents\monthly car payment.c(50): error #2168: Operands of ^ have incompatible types 'double' and 'double'.
C:\Users\student\Documents\monthly car payment.c(50): error #2001: Syntax error; found 'printf' expecting ';'.
C:\Users\student\Documents\monthly car payment.c(53): error #2001: Syntax error; found '}' expecting ';'.
*** Error code: 1 ***

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: What do these errors mean?
« Reply #1 on: October 01, 2014, 03:01:59 AM »
Seriously?  :'(

Ok, another hint: The errors/error lines do not always point to the actual mistake, but to a line or piece of code right before that line...

Ralf