Question: Problem Description: Numbering Systems Conversion Quiz for High School Students Integrating Computer Science in school education is emerging as a new direction in advanced education
Problem Description: Numbering Systems Conversion Quiz for High School Students
Integrating Computer Science in school education is emerging as a new direction in advanced education systems. In a local high school, a technology teacher has taught his students about the numbering systems conversions. Students were taught that a decimal number, which is used in their daily lives, is represented in computers as a binary number. A binary number consists of a sequence of 0s and1s. Students have also learned how to convert a decimal number to a binary number and vice versa. In addition, since binary numbers can be very large and cumbersome, the teacher has explained to the students that hexadecimal numbers are usually used to abbreviate binary numbers. Students have also learned how to convert numbers from decimal to hexadecimal and vice versa.
At the end of this learning module on numbering systems, student must take a computerized practice quiz. Your job is to write a program that implements this practice quiz. The quiz consists of 4 parts and in each part, students are asked 2 random questions (Total = 8 questions). The four parts of the quiz are as follows:
1. Convert from Decimal to Hexadecimal (2 questions)
For this part of the quiz, a student is asked two questions. For each question, a random decimal number between 0 and 255 is generated, and the student is asked to enter the equivalent hexadecimal number.2. Convert from Decimal to Binary (2 questions) For this part of the quiz, a student is asked two questions. For each question, a random decimal number between 0 and 255 is generated, and the student is asked to enter the equivalent binary number.
3. Convert from Hexadecimal to Decimal (2 questions).
For this part of the quiz, a student is asked two questions. For each question, a random hexadecimal number of 2 digits is generated, and the student is asked to enter the equivalent decimal number. 4. Convert from Binary to Decimal (2 questions) For this part of the quiz, a student is asked two questions. For each question, a random binary number of 8 bits is generated, and the student is asked to enter the equivalent decimal number.
Important Remarks about the quiz implementation:
Each question is worth 2 points and the final grade is out of 16.
For each question, the student will be given 3 trials to answer the question.
If the answer is correct in any of the trials 1 through 3, an appropriate message is displayed (e.g., Correct
Answer!).
If the maximum number of trials is exceeded, the student will lose the points for that question and an
appropriate message is displayed (e.g., Sorry, you have exceeded the maximum number of trials for this
question!).
At the end of the practice quiz, the students answers for all of the questions and a number of statistics
are displayed. The statistics include:
A percentage grade out 100% (you need to convert the grade out of 16 to a percentage).
The time taken to take the quiz from beginning to end.
The passing percentage for the practice quiz is 60%, an appropriate message is displayed
indicating whether or not a student has passed the test (e.g., You didnt pass the quiz!).
After each quiz is finished, the program should ask the user to continue for another quiz or not until the user choose to stop taking quizzes. Please see output in the SAMPLEOUTPUT file.
Hints:
For explanations about the numbering systems conversion (please refer to Appendix F of your text book)
YOU CAN USE any of the Math or String methods studied in Chapter 4.
You Should Not USE:
Any of the methods in the Integer class to convert an integer number to binary or hexadecimal. In other words, using Integer.toBinaryString (num) or Integer.toHexString (num) is NOT ALLOWED.
_____________________________________________________ SAMPLE RUN ______________________________________________________ run: ************************************************ Welcome to the Numbering System Conversion Quiz! ************************************************ The quiz consists of 8 random questions on converting between Decimal, Binary, and Hexadecimal numbers. You have a maximum number of 3 trials per question. Please enter 1 to start the quiz or 0 to exit: 1 Please enter the equivalent Hexadecimal number of 123: 7B Correct Answer! Please enter the equivalent Hexadecimal number of 45: 2D Correct Answer! Please enter the equivalent Binary number of 8: 1000 Correct Answer! Please enter the equivalent Binary number of 171: 10101011 Correct Answer! Please enter the equivalent Decimal number of 7F: 129 Wrong Answer! Please enter the equivalent Decimal number of 7F: 128 Wrong Answer! Please enter the equivalent Decimal number of 7F: 126 Sorry, you have exceeded the maximum number of trials for this question! Please enter the equivalent Decimal number of 5D: 93 Correct Answer! Please enter the equivalent Decimal number of 11110100: 243 Wrong Answer! Please enter the equivalent Decimal number of 11110100: 244 Correct Answer! Please enter the equivalent Decimal number of 00111000: 56 Correct Answer! ************************************ Time taken to complete the quiz: 2.5 minutes Score is: 87.5% Congratulations, you have passed! ************************************ Detailed Results: --------------------- The equivalent Hexadecimal number of 123 is 7B: correct The equivalent Hexadecimal number of 45 is 2D: correct The equivalent Binary number of 8 is 1000: correct The equivalent Binary number of 171 is 10101011: correct The equivalent Decimal number of 7F is 129: wrong The equivalent Decimal number of 5D is 93: correct The equivalent Decimal number of 11110100 is 244: correct The equivalent Decimal number of 00111000 is 56: correct >> Do you want to contiune for another trial quiz (Y/N): N *** Thank you for using this Application ***
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
