#include <stdio.h>
int checkEligibility (float gpa, int creditHours, int hasViolations, int hasRecomendations)
{
int isEligible = (gpa >= 3.5 || hasRecomendations) && creditHours >= 60 && !hasViolations;
return isEligible;
}
int main ()
{
float gpa;
int creditHours, hasViolations, hasRecomendations;
printf ("Introduce el GPA: ");
scanf ("%f", &gpa);
printf ("%.2f\n", gpa);
printf ("Introduce las horas de crédito: ");
scanf ("%d", &creditHours);
printf ("%d\n", creditHours);
printf ("¿Tiene violaciones? (1-->Sí; 0-->No): ");
scanf ("%d", &hasViolations);
printf ("%d\n", hasViolations);
printf ("¿Tiene recomendaciones? (1-->Sí; 0-->No): ");
scanf ("%d", &hasRecomendations);
printf ("%d\n", hasRecomendations);
if (checkEligibility(gpa, creditHours, hasViolations, hasRecomendations))
{
printf("The student is eligible for the scholarship.\n");
} else
{
printf("The student is not eligible for the scholarship.\n");
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: