I'm trying to write a program, but unfortunately, despite no error messages, the terminal output is empty. Can you please help me?
#include <stdio.h>
#include <stdlib.h>
double tuitonFee(int student_id, int credit, int year, double tuiton_0, double tuiton_1);
int main()
{
int student_id, credit, year;
printf("Enter the student id (-1 to exit): ");
scanf_s("%d", &student_id);
if (student_id == -1)
{
exit(0);
}
printf("Enter the credit: ");
scanf_s("%d", &credit);
printf("Enter year: ");
scanf_s("%d", &year);
double tuiton_0 = 525 * credit;
double tuiton_1 = 4500 + (750 * credit);
double tuitonFee(student_id, credit, year, tuiton_0, tuiton_1);
return 0;
}
double tuitonFee(int student_id, int credit, int year, double tuiton_0, double tuiton_1)
{
if (credit <= 12)
{
if (year == 4)
{
printf("Student with id %d will pay tuiton %.0lf$", student_id, tuiton_0);
}
else
{
printf("Student with id %d will pay tuiton %.0lf$", student_id, tuiton_0 * 0.15);
}
}
else if (credit > 12)
{
if (year == 4)
{
printf("Student with id %d will pay tuiton %lf$", student_id, tuiton_1);
}
else
{
printf("Student with id %d will pay tuiton %.0lf$", student_id, tuiton_1 * 0.15);
}
}
return credit;
}
I tried to change variables, and function names and research the problem on the internet, but I didn't find the solution.