Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this problem you are to calculate the semester fee for the undergraduate stud

ID: 3671345 • Letter: I

Question

In this problem you are to calculate the semester fee for the undergraduate students studying in different years. We have four categories for year- 'F','S',and,'R' and each category has its own tuition fee rates. Students can get registered for these amount of credit hours only - 3, 6, 9, 12, and 15. There is also a general fee imposed, which is 15% of the total tuition fee. Semester fee is the cumulative total of the tuition fee and the general fee. For example, a sophomore student registered for 9 credit hour in a semester will have tuition fee (9*dolar 1225) = dollar 11025 and general fee (dollar 11025*.15) = dollar 1653.75. So the total semester fee will be (dollar 11025 + dollar 1653.75) = dollar 12678.75 Write a program that lets the user specify the year and the credit hours and then calculates the semester fee for the student. Use a loop so that the user can enter several cases. If something other than the four category choices or valid credit hours is entered, the program should remind the user what the proper categories or valid credit hours are and then recycle. Entering 'Q' should quit your program. the program should keep track of the semester fee totals of all the valid cases and display the cumulative semester fee total at the end of your program.

Explanation / Answer


#include <stdio.h>

int main()
{
    char ch;
    int hr,rate;
    double fees, total;

    total = 0;
    while(1)
    {
        printf("Enter year (F/S/J/R) or Q to quit::");
        scanf(" %c",&ch);

        if(ch=='Q')
        {
            printf("Cumulative valid fees were %0.2f ",total);
            return 1;
        }
        if(ch=='F'||ch=='S'||ch=='J'||ch=='R')
        {
            printf("Enter credit hours(3/6/9/12/15): ");
            scanf(" %d",&hr);

            if(hr==3||hr==6||hr==9||hr==12||hr==15)
            {
                if(ch=='F')
                    rate = 1175;
                else if(ch=='S')
                    rate = 1225;
                else if(ch=='J')
                    rate = 1350;
                else if(ch=='R')
                    rate = 1400;
                else
                    rate = 0;

                fees = rate*hr + rate*hr*0.15;
                total += fees;
                printf("Total fees = %0.02lf ", fees);
            }
            else
            {
                printf(" You entered wrong credit You can only enter 3 or 6 or 9 or 12 or 15 Try again!!");
            }

        }else
        {
            printf(" You entered wrong year You can enter only F or S or J or R Try again!!!");
            continue;
        }
    }
return 1;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote