Create the package named by,gsu,asoilab for the superclass and subclasses

Страницы работы

Содержание работы

Variant 1

Create the package named by.gsu.asoilab for the superclass and subclasses.

Define the superclass, describing the candidate trial, and three subclasses: LightTrial, StrongTrial (see jse12.doc, page 22) and ExtraTrial.

Last trial contains additional test. This trial is passed if base trial is passed and the mark on additional test is greater than a given subclass constant.

Define the Runner class in the default package, where:

1. Create an array for 11 objects (5 – of superclass and 2 – of every subclass).

2. Print the array content to the console (one element per line).

3. Sort trials by the account and the sum of first and second marks.

4. Print the array content to the console (one element per line).

5. Print superclass trials for account equaled to a command line argument. Don’t use getClass( ) method.

6. Clear all marks for failed trials.

7. Print the array content to the console (one element per line).

Variant 2

Create the package named by.gsu.asoilab for the superclass and subclasses.

Define the superclass, describing the candidate trial, and two subclasses: LightTrial, StrongTrial (see jse12.doc, page 22).

Define the Runner class in the default package, where:

1. Create an array for 10 objects (4 – of superclass and 3 – of every subclass).

2. Print the array content to the console (one element per line).

3. Which test is more difficult (criterion is a sum of all marks for a test).

4. Clear all marks for failed trials.

5. Print the array content to the console (one element per line).

6. Print superclass trials using instanceof operation.

Variant 3

Create the package named by.gsu.asoilab for the superclass and subclasses.

Define the superclass, describing the candidate trial, and two subclasses: LightTrial, StrongTrial (see jse12.doc, page 22).

Define the Runner class in the default package, where:

1. Create an array for 7 objects (3 – of superclass and 2 – of every subclass).

2. Print the array content to the console (one element per line).

3. How many trials are passed.

4. Find the sum of all marks for the first test.

Похожие материалы

Информация о работе