Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(((IN JAVA)))Create a class called Question that contains one private field for the question's text . Provide a single argument constructor. Override the toString() method

(((IN JAVA)))Create a class called Question that contains one private field for the question's text. Provide a single argument constructor. Override the toString() method to return the text.

Create a subclass of Question called MCQuestion that contains additional fields choices and answer. Provide a suitable constructor. Override the toString() method to return all data fields (use the toString() method of the Question class).

Write a test program that creates a MCQuestion object with values of your choice. Print the object using the toString method.

Here is a sample run of the program:

Question:

Variables that are shared by every instance of a class are:

a. public variables

b. private variables

c. instance variables

d. class variables

note: make the qustion "What is the sum of two even numbers " and put chocise as

a) odd

b)nor odd or even

c)No anwser

d)even

note:please put each class in a sperate step so i can have each class in different file

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

Draw a schematic diagram of I.C. engines and name the parts.

Answered: 1 week ago