Scaling your Grades

Wednesday 1 May 2013

Being a student is challenging, there are a lot of pressures not just in your subjects but also with your professors, yet you can still find lots of fun with your friends. One thing we look forward to when semesters are near ending are the grades we get from our professors. Most of us hope for the best grades, some  of us accept any grades as long as it is on the passing rate.

Thinking about this, I come up with the idea of making a grade scale program which will determine if your grade is poor, satisfactory or excellent. In this program, the grades you input will be evaluated. Check out the codes below.



#include<stdio.h>
#include<conio.h>

main()
{

 float var2;
 printf("PASSED or FAILED??\n");
 printf("Enter your grade in any subject: ");
 scanf("%f", &var2);
 printf("\nYour grade is %.2f. ", var2);
 if(var2==75)
    printf("Just enough to get you through!\n");        
 else
    if(var2<75)
       printf("Sorry but you have to repeat the subject!\n");     
    else   
       if(var2>75 && var2<80)
          printf("You made it, but you have to try harder next time!\n");
       else
          if(var2>=80)
             printf("It's is good. Keep it up. Congratulations!");
     
 getch();      
}


The program will ask you to enter your grade. After that, it will go through the if else statements. If your grade matches one statement then it will show you the result of the evaluation. Check out the sample output below.





Hope you learned something from this post. Feel free to leave a comment below. Thanks!

No comments:

Post a Comment

Please do leave a comment. It's gonna be a friendly conversation between programmers. Hope you do find our blog helpful. Thank you!

Related Posts Plugin for WordPress, Blogger...