In the 1st semester of 2012, in the TSIN course at Uninove, the teacher asked for a program that calculated the average of three grades for a student. The program was written in C on DEV C++.

`#include #include main(){ char op; do{ float n1=11,n2=11,n3=11,average; printf("\tFabio Bmed TSIN Uninove - www.fabiobmed.com.br\n\tProgram calculates average of 3 grades\n\n"); //NOTE 1 while((n1>10) || (n1<0)){ printf("\tEnter the first note: "); scanf("%f",&n1); if ((n1>10) || (n1<0)){ printf("\tIncorrect grade. Please enter a grade between 1 and 10:\n\n"); } else{ break; } } //NOTE 2 while((n2>10) || (n2<0)){ printf("\tEnter the second note: "); scanf("%f",&n2); if ((n2>10) || (n2<0)){ printf("\tIncorrect grade. Please enter a grade between 1 and 10:\n\n"); } else{ break; } } //NOTE 3 while((n3>10) || (n3<0)){ printf("\tEnter the third note: "); scanf("%f",&n3); if ((n3>10) || (n3<0)){ printf("\tIncorrect grade. Please enter a grade between 1 and 10:\n\n"); } else{ break; } } mean=(n1+n2+n3)/3; printf("\n\tNote 1: %.2f \n\tNote 2: %.2f \n\tNote 3: %.2f \n\n\tThe media e: %.2f\n\n",n1, n2,n3,average); printf("\tDo you want to calculate a new average? Y - Continue | N - Exit: "); getchar(); scanf("%c",&op); system("cls"); } while(op == 's'); }`