B4Coder

🏛️ College Admission (Form Logic) · Mission 6 of 6

🏛️ The Admission Desk

Put it all together: check everything, and either admit the student with their fee or list what to fix.

Your mission

  1. showRoom = form.hostel. errors = [ ].
  2. Add an error for an empty name, an age outside 17–25, and marks below the course's cut-off (60, 50 or 45).
  3. No errors: ok = true, work out the fee, message = "Admitted to " + form.course + "! Fee: ₹" + fee. Otherwise ok = false, message = "Please fix " + length(errors) + " problem(s)".

Getting the mission ready…