computer science programming assignment

assignment in upload

previous assignment 

  Quiz.java

 Quiz.Java

Public class Quiz {

  Public static void main(String[] args)

             MultipleChoiceQuestion question1= new MultipleChoiceQuestion(

                        ”1. Which two NFL Teams will be playing in the super bowl 2022?”,

                    ”Rams and Bengals”,

                    “Packers and Commanders”,

                    “Vikings and Eagles”,

                    “Raiders and Saints”,

                    “Dolphins and Bears”,

                    “a”);

            MultipleChoiceQuestion question2= new MultipleChoiceQuestion(

                    “2. Which continent is the United States of America Located?”,

                   ”Asia”,

                   ”Antarctica”,

                   ”Oceania”,

                   ”Europe”,

                    ”Africa”,

                    ”North America and South America”,

                   ”d”);

            MultipleChoiceQuestion3 question3=new MultipleChoiceQuestion(

                   ”3. What is Lebron James Career?”,

                     “Diplomat”,

                     “Soccer Player”,

                     “Teacher”,

                     “Basketball Player,”

                     “Soccer Player”,

                      ”d”);

            MultipleChoiceQuestion question4 = new MultipleChoiceQuestion(

                    ”4. Who is the owner of Tesla?”,

                     “Barack Obama”,

                     ”Elon Musk”,

                     ”Kim kardashian”,

                     ”Stephen curry”

                     ”Bill Gates”,

                      ”b”);

            MultipleChoiceQuestion question5=new MultipleChoiceQuestion(

           “5. Who featured on the song Despacito?”,

                ”Daddy Yankee”,

                “Chris Brown”,

                “Justin Timberlake”,

                “Bad Bunny”,

                “Jay z”,

                ”a”);

           question1.check();

           question2.check();

           question3.check();

           question4.check();

           question5.check();

            MultipleChoiceQuestion.showResults( );

     }

}

            MultipleChoiceQuestion.java

            import javax.swing.JOptionPane;

            class MultipleChoiceQuestion                                                                            {                                                                                                                                      static int nQuestions

                  String questions;                                                                                                  String correctAnswer;

               MultipleChoiceQuestions( String a, String b, String c , String d,            String e, String answer)                                                                                               {                                                                                                                       question +=”A, Rams and bengalsn”;                                                               question +=”B, North America and South American”;                                   question +=”C, Basketballn”;                                                                             question +=”D, Elon muskn”;                                                                             question +=”E, Daddy yankeen”;

          Answer = answer.toUpperCase( );

}

String ask()                                                                                                            {                                                                                                                                  String answer;                                                                                                                  while(true)                                                                                                             {

           answer= JOptionPane.showInputDialog(question);                                         answer= answer.toUpperCase();                                                                                                                                                                                                       if(answer.equals(”A”) || answer.equals(”B”) || answer.equals(”C”) || answer.equals(”D”)|| answer.equals(”E”)) {                                                      return answer;                                                                                                      }else{                                                                                                                     JOptionPane.showMessageDialog(null,”Invalid! Please enter A,B,C,D,or E.”);                                                                                                                                                    }

               }

}  

               String answer=ask();                                                                                           if(answer.equals(correctAnswer))                                                                     {                                                                                                                                           JOptionPane.showMessageDialog(null,”Correct!”);                                          nCorrect++;                                                                                           }                                                                                                                             else                                                                                                                            JOptionPane.showMessageDialog(null,”Incorrect. The correct answer is “+correctAnswer+”.”);                                                                                          nQuestions++;                                                                                                   }                                                                                                                               static void showResults()                                                                                      {                                                                                               JOptionPane.showMessageDialog(null,nCorrect+” correct out of ”+nQuestions+” questions.”);                                                                              


                                             



Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more