Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

writ a program that asks the user a quiz question and prompts them for an answer until they get the question correct. This program will

writ a program that asks the user a quiz question and prompts them for an answer until they get the question correct. This program will be the basis for future Programming Assignments in this course.

These instructions assume you are using the Eclipse IDE on your own computer. You may use a different Java environment as long as you can provide your Java code and screenshots for your assignment submission.

Download theUnit 2 Programming Assignmentinstructions.

Upload the following for your Programming Assignment submission.

  • Quiz.java
  • Screenshot showing the input dialog with the quiz question
  • Screenshot showing the message dialog for the correct answer
  • Screenshot showing the message dialog for a valid but incorrect answer
  • Screenshot showing the message dialog for an invalid answer

Your assignment will be graded by your peers using the following criteria.

  • Does the submission include the file "Quiz.java"?
  • Does the file include a public class called "Quiz" with a public static method called "main"?
  • Does the main method have one or more String assignment statements that create a multiple-choice question String?
  • Does the main method have a String assignment statement that records the answer to the quiz question, where the question is an argument to the method "JOptionPane.showInputDialog"?
  • Does the main method convert the answer String using the "toUpperCase" method?
  • Does the main method display a message indicating that the answer iscorrectwhen the answer matches a particular String ("A", "B", "C", "D", or "E")?
  • Does the main method display a message indicating that the answer isincorrectwhen the answer matches particular Strings ("A", "B", "C", "D", or "E", but not the correct choice)?
  • Does the main method display a message indicating that the answer isinvalidwhen the answer does not match any of the expected Strings ("A", "B", "C", "D", or "E")?
  • Does the main method continue to ask the quiz question until the answer is deemed correct?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transport Operations

Authors: Allen Stuart

2nd Edition

978-0470115398, 0470115394

Students also viewed these Programming questions

Question

19 Setting objectives, determining strategy and tactics

Answered: 1 week ago