You've been asked to create a web application that calculates students annual fees. The application should allow students to capture basic information such as their name, student number, current year and course they are doing. It should then be able to work out the subtotal, discount, and total amount a student should pay a year for their course.
A student can only be enrolled in 1 course. You can assume a base fee of R35k a year for a course.
Discounts:
- 1st years
- 5% discount
- 2nd years
- 10% discount
- 3rd years
- 20% discount
Your application should include the following fields:
-
Student Name
-
Student Number
- Should only accepts numbers
-
Courses
- This field must be a dropdown, you can populate it with whichever course you like
-
Year
- Student's current year. A student can be a 1st year, 2nd year or 3rd year.
-
Calculate button
- When clicked your button should perfom the following actions:
- Calculate and display
subtotal
,discount
andtotal
- Display captures information,
Student Name
,Student Number
,Course
andYear
- Calculate and display
- When clicked your button should perfom the following actions:
-
Reset button
- Should reset your application, so you can calculates fees for another student
<TODO: Validation & Error Handling>
<TODO: UI Improvements>
<TODO: Feedback Mechanism>
Rewrite the current app to use a Student
class. All the logic to calculate the subtotal
, discount
and total
should live inside that class.
Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes