Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I would like to know how I could develop object-oriented features of Javausing the code below. I would like to know in particular how the

I would like to know how I could develop object-oriented features of Javausing the code below. I would like to know in particular how the program could use:

describe how the program could use each of the following:

  1. class variables
  2. instance variables
  3. inheritance
  4. polymorphism
  5. abstract classes,
  6. "this"
  7. "super"
  8. interfaces
  9. event listeners

The actual file is below:

public class Quiz {  public static void main(String[] args)  {    Question question = new MultipleChoiceQuestion("Who is the president of the united states",          "Obama",          "Bush",          "Clinton",          "Trump",          "Nixon",          "D");      //every time we instantiate the object we call on check method      question.check();      question = new MultipleChoiceQuestion("What is the name of the Indonesia capitol",          "Yangon",          "Shanghai",          "Washingaton",          "Jakarta",          "London",          "D");      question.check();      question = new MultipleChoiceQuestion("What is the sum of 10 and 70",          "4344",          "222",          "87",          "80",          "45",          "D");      question.check();      question = new MultipleChoiceQuestion("What is the capitol of Pennesylvania",          "Harrisburg",          "Philadelphia",          "Scranton",          "Eary",          "June",          "A");      question.check();      question = new MultipleChoiceQuestion("What is 35 divided by 5",          "12",          "47",          "7",          "80",          "45",          "C");      question.check();            //true or false questions here      question = new TrueFalseQuestion("Nicolas Cage and Michael Jackson both married the same woman.", "true");      question.check();      question = new TrueFalseQuestion("The mathematical name for the shape of a Pringle is hyperbolic paraboloid.", "true");      question.check();      question = new TrueFalseQuestion("Michael Keaton's real name is Michael Jackson.", "FALSE");      question.check();      question = new TrueFalseQuestion("Donald Duck's middle name is Fauntelroy.", "TRUE");      question.check();      //lastly we show the results      question.showResults();  } } 

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

Step: 3

blur-text-image

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions