Question
I got this note from my teacher I would like to know where to make the corrections Good, but you must indent your code.
Create a pseudocode design to prompt a student for their Student ID and the titles of the three classes they want to add. The solution should display the Students ID and a total bill.
Bill a student using the following rules:
Students can only add up to 3 classes at a time.
Each class costs $150.00
A 5% technology fee is added to the total cost.
If the student is taking three classes and working for more than 20 hours per week, a message displays prompting the make an appointment with their faculty advisor.
If the student adds more than three classes, an error message is printed.
# taking student Id as input
DISPLAY "Enter a StudentID? "
READ studentId
# reading How many classes student want to opt for
DISPLAY "Enter how many classes you want to add? "
DISPLAY "*****1 class free if you opt for three classes*****"
READ no_of_classes
# checking if user enters more than 3 classes
IF no_of_classes > 3 THEN
OUTPUT "More than 3 classes not allowed, max allowed is 3 classes"
EXIT
ENDIF
# reading class titles of each of the class user enters
FOR i <- 1 TO no_of_classes
OUTPUT "Enter the class title"
READ class[i]
ENDFOR
# reading number of hours user work per week
DISPLAY "Enter number of hours you work per week? "
READ no_of_hours
# if no of classes opted is 3
IF no_of_classes == 3 THEN
# one class free that's why subtracting 150
class_cost = 150 * no_of_classes - 150
# calculating the bill
bill = class_cost + (5/100) * class_cost
# if number of hours greater than 20 per week
IF no_of_hours > 20
THEN
OUTPUT "Please make an appointment with the faculty advisor"
ENDIF
# if number of classes opted is less than 3
ELSE
class_cost = 150 * no_of_classes
bill = class_cost + (5/100) * class_cost
ENDIF
OUTPUT "STUDENTID : ", studentId
OUTPUT "Total bill need to be paid is: ", bill
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started