# Write a Pseudocode to calculate the total fee amount to be collected from a student.

Refer the table below for fee details.(5 Marks)Student TypeStudent Type denoted asFee DetailsMerit Seat Day ScholarMSDSTuition fee + Bus feeMerit Seat HostellerMSHTuition fee + Hostel feeManagement Seat Day ScholarMGSDS150% of Tuition fee + Bus feeManagement Seat HostellerMGSH150% of Tuition fee + Hostel fee

## Pseudocode:

- Prompt the user to enter the student type (MSD, MSH, MGSD, MGSH).
- Prompt the user to enter the tuition fee, bus fee, and hostel fee.
- Calculate the total fee amount based on the given fee details and student type:
- If student type is MSD:
- Set total fee amount to tuition fee + bus fee.
- Else if student type is MSH:
- Set total fee amount to tuition fee + hostel fee.
- Else if student type is MGSD:
- Set total fee amount to (1.5 * tuition fee) + bus fee.
- Else if student type is MGSH:
- Set total fee amount to (1.5 * tuition fee) + hostel fee.
- Display the total fee amount.

Example pseudocode:

```
Procedure CalculateTotalFee():
studentType <- Prompt user for student type (MSD, MSH, MGSD, or MGSH)
tuitionFee <- Prompt user for tuition fee
busFee <- Prompt user for bus fee
hostelFee <- Prompt user for hostel fee
totalFeeAmount <- 0

If studentType = MSD Then
totalFeeAmount <- tuitionFee + busFee
Else If studentType = MSH Then
totalFeeAmount <- tuitionFee + hostelFee
Else If studentType = MGSD Then
totalFeeAmount <- (1.5 * tuitionFee) + busFee
Else If studentType = MGSH Then
totalFeeAmount <- (1.5 * tuitionFee) + hostelFee

Display "Total fee amount to be collected: " + totalFeeAmount
End Procedure

Call CalculateTotalFee()
```

Please note that the above pseudocode assumes that the user will provide valid input. You may need to add additional error handling if necessary.

## To calculate the total fee amount to be collected from a student, you can use the following pseudocode:

1. Input studentType
2. Input tuitionFee
3. Set busFee = 0
4. Set hostelFee = 0
5. Set totalFee = 0

6. If studentType equals "MSDS" (Merit Seat Day Scholar) or "MSHT" (Merit Seat Hosteller), go to step 9.
7. If studentType equals "MGSDS" (Management Seat Day Scholar) or "MGSH" (Management Seat Hosteller), go to step 10.
8. If none of the above, display an error message and end the program.

9. Set busFee = inputBusFee
10. If studentType equals "MSHT" or "MGSH":
a. Set hostelFee = inputHostelFee
11. Calculate totalFee:
a. For "MSDS": totalFee = tuitionFee + busFee
b. For "MSHT": totalFee = tuitionFee + hostelFee
c. For "MGSDS": totalFee = (1.5 * tuitionFee) + busFee
d. For "MGSH": totalFee = (1.5 * tuitionFee) + hostelFee
12. Display totalFee

Note: You would need to replace inputBusFee and inputHostelFee with appropriate code to input the bus fee and hostel fee, respectively.

## To calculate the total fee amount to be collected from a student, you can use the following pseudocode:

1. Start
2. Declare variables:
- studentType: the type of student (Merit Seat Day Scholar, Merit Seat Hosteller, Management Seat Day Scholar, or Management Seat Hosteller)
- tuitionFee: the tuition fee for the student
- hostelFee: the hostel fee (if applicable)
- busFee: the bus fee (if applicable)
- totalFee: the total fee amount to be collected

3. Prompt the user to enter the student type.
4. Read and store the student type in the variable studentType.
5. Prompt the user to enter the tuition fee.
6. Read and store the tuition fee in the variable tuitionFee.
7. Use a conditional statement to determine the student type and calculate the total fee accordingly:
- If studentType is MSDS (Merit Seat Day Scholar), calculate the totalFee as tuitionFee + busFee.
- If studentType is MSH (Merit Seat Hosteller), calculate the totalFee as tuitionFee + hostelFee.
- If studentType is MGSDS (Management Seat Day Scholar), calculate the totalFee as 1.5 * tuitionFee + busFee.
- If studentType is MGSH (Management Seat Hosteller), calculate the totalFee as 1.5 * tuitionFee + hostelFee.
- Otherwise, display an error message indicating an invalid student type.
8. Display the total fee amount (totalFee).
9. End.

Note: Make sure to handle any necessary validations and ensure that the user enters the correct fee details for the specific student type.