Question-1: The abstract Animal class has four concrete subclasses named mammals, amphibians, Reptiles, and Birds. Each of these four classes has a different number of legs and weights in kilograms. The weights of each category are 100, 40, 200, 25 KGs respectively. Create six different objects from these four categories, and store them in a one-dimension array. Display the entries in the array and their total weights and legcounts. Question-2 is assigned to even registration numbers

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 2CP
icon
Related questions
Question
Question-1:
The abstract Animal class has four concrete subclasses named mammals, amphibians, Reptiles, and Birds. Each of these four classes has a different number of legs and weights in kilograms. The weights of each category are 100, 40, 200, 25 KGs respectively. Create six different objects from these four
categories, and store them in a one-dimension array. Display the entries in the array and their total weights and legcounts.
Question-2 is assigned to even registration numbers
Question-2:
Write a java program for the course registration using a string array. The number of courses available is B. Name the courses according to your conveyance, initialize a list with the Register numbers of 20 students. Assign the registration numbers randomly from this list to eight courses. The program has to
ensure that no student is allowed to register for more than five courses, If a student is registered for more than five-course, throw a textual error message and print the same with the registration numbers of the students who are violating this condition.
Transcribed Image Text:Question-1: The abstract Animal class has four concrete subclasses named mammals, amphibians, Reptiles, and Birds. Each of these four classes has a different number of legs and weights in kilograms. The weights of each category are 100, 40, 200, 25 KGs respectively. Create six different objects from these four categories, and store them in a one-dimension array. Display the entries in the array and their total weights and legcounts. Question-2 is assigned to even registration numbers Question-2: Write a java program for the course registration using a string array. The number of courses available is B. Name the courses according to your conveyance, initialize a list with the Register numbers of 20 students. Assign the registration numbers randomly from this list to eight courses. The program has to ensure that no student is allowed to register for more than five courses, If a student is registered for more than five-course, throw a textual error message and print the same with the registration numbers of the students who are violating this condition.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT