Case Study 4 - Applied Computing Trivia Challenge

Quiz Score Evaluation Tool

Enter the number of questions and the number of correct answers to calculate the quiz percentage. This version uses exception handling to display error messages for invalid input.





Debugging Summary

For this project, I used exception handling with a try and catch statement to handle invalid user input. I tested the form by entering blank values, zero questions, negative numbers, and more correct answers than total questions. I also used the browser console to check for JavaScript errors while testing the page.

The try block runs the score calculation, and the catch block displays a helpful error message if the user enters invalid data. This prevents the program from calculating an incorrect score or displaying confusing results.

By: Hussein Almoadhen