Answered step by step
Verified Expert Solution
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:
- class variables
- instance variables
- inheritance
- polymorphism
- abstract classes,
- "this"
- "super"
- interfaces
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started