Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include <stdlib.h>
- #include <limits.h>
- int main()
- {
- system("color A");
- int num=0, aqua=0, megumin=0, makoto=0;
- int max =-0, min= INT_MAX, score, nos, total, tot_aqua=0, tot_megumin=0, tot_makoto=0;
- int aCount=0, bCount=0, cCount=0, dCount=0, fCount=0;
- while(0?(!1):(!0)){
- printf("\nEnter Assignment Score : ");
- scanf("%d", &aqua);
- if (aqua>max) max=aqua;
- if (aqua<min) min=aqua;
- printf("\nEnter Mid Score : \t");
- scanf("%d", &megumin);
- if (megumin>max) max=megumin;
- if (megumin<min) min=megumin;
- printf("\nEnter Final Score : \t");
- scanf("%d", &makoto);
- if (makoto>max) max=makoto;
- if (makoto<min) min=makoto;
- bool x=(aqua <= -1) || (megumin <=-1) || (makoto <=-1);
- if(x){
- printf("\nTotals for each letter grade are:\n");
- printf("A= %d\t", aCount);
- printf("B= %d\t", bCount);
- printf("C= %d\t", cCount);
- printf("D= %d\t", dCount);
- printf("E= %d\t", fCount);
- return 0;
- }else{
- score = 0.3 * aqua + 0.3 * megumin + 0.4 * makoto;
- printf("\nAssingment Score : %d Mid Score : %d Final Score : %d", aqua, megumin, makoto);
- printf("\nMin Number is : %d", min);
- printf("\nMax Number is : %d", max);
- printf("\nTotal Score : %d", score);
- if(score>100)printf("Sorry, Max Score 100\n");
- else{
- switch(score/10)
- {
- case 10:
- case 9:
- printf("\n====================");
- printf("\nYou Got A Grade.");
- printf("\n====================");
- ++aCount;
- break;
- case 8:
- case 7:
- printf("\n====================");
- printf("\nYou Got B Grade.");
- printf("\n====================");
- ++bCount;
- break;
- case 6:
- printf("\n====================");
- printf("\nYou Got C Grade.");
- printf("\n====================");
- ++cCount;
- break;
- case 5:
- case 4:
- printf("\n====================");
- printf("\nYou Got D Grade.");
- printf("\n====================");
- ++dCount;
- break;
- default:
- printf("\n====================");
- printf("\nYou Got E Grade.");
- printf("\n====================");
- ++fCount;
- break;
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement