CS 1102-Unit01 programming assignment

.docx

School

University of the People *

*We aren’t endorsed by this school

Course

1102

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

3

Uploaded by BaronEmuPerson965

Report
You are tasked with creating a Java program that simulates a simple quiz game. The program should prompt the user with a series of questions and allow them to enter their answers. After the user has answered all the questions, the program should compute and display the final score based on the number of correct answers. For this assignment, write a Java program that implements the functionality described in the scenario. Ensure that your program is error-free, compiles successfully, and produces the expected output. Test your program with different inputs to verify its correctness. Make sure the following requirements are met: o The program should include five multiple-choice questions with four options. o The four options should be labeled A, B, C, and D. o The program should prompt the user to enter their answer by typing the corresponding letter (A, B, C, or D). o After the user has entered their answer for each question, the program should compare it to the correct answer and keep track of the number of correct responses. o The program should compute and display the final score as a percentage of the total number of questions. o Use if and switch case statements to handle user input and compare it to the correct answers. o Include comments to explain the purpose of each section of code and enhance code readability.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help