1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

grade prediction program

Discussion in 'C' started by hygy486, Sep 10, 2006.

  1. hygy486

    hygy486 New Member

    Joined:
    Sep 10, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    here is my code i get an error of call of non function in lines 29, 34, 39 and 44


    apprecite help or an alternate code if possible

    here is code
    Code:
     int main (void)
    {
      char desiredgrade;
      double min_average;
      double currentaverage;
      double weight;
      double score;
      printf("Please enter your desired grade: \n");
      scanf("%c", &desiredgrade);
      printf("Please enter your minimum average required:  \n");
      scanf("%lf", &min_average);
      printf("Please enter your current average in course:  \n");
      scanf("%lf", &currentaverage);
      printf("Please enter how much the final counts as a percentage of the course grade:  \n");
      scanf("%lf", &weight);
      if ( 92<=desiredgrade && desiredgrade>=100)
    {
      score=(min_average-(100-weight)(currentaverage/100)+(100/weight));
      printf("You need a score of %.2f on the final to get A\n",score);
    }
      else if (84<=desiredgrade && desiredgrade>=91)
    {
      score=(min_average-(100-weight)(currentaverage/100)+(100/weight));
      printf("You need a score of %.2f on the final to get B\n",score);
    }
      else if (76<=desiredgrade && desiredgrade>=83)
    {
      score=(min_average-(100-weight)(currentaverage/100)+(100/weight));
      printf("You need a score of %.2f on the final to get C\n",score);
    }
      else if (68<=desiredgrade && desiredgrade>=75)
    {
      score=(min_average-(100-weight)(currentaverage/100)+(100/weight));
      printf("You need a score of %.2f on the final to get D\n",score);
      return 0 ;
    }
      return score ;
    }
     
  2. tiger12506

    tiger12506 New Member

    Joined:
    Jun 6, 2007
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    C does not understand that this -> (x)(y) means x times y.
    It thinks that you are trying to call function "x" with argument "y"
    All you need to do is change every occurance of (x)(y) with (x)*(y)
     

Share This Page