OBJECT ORIENTED PROBLEM SOLVING SKILLS
[
Log In
]
Home
OOP
Classes and Objects
Question 1
Question 2
Question 3
Constructors
Question 1
Question 2
Question 3
Question 4
Inheritance
Question1
Question2
Question3
Question4
Polymorphism
Question1
Help
Inheritance
Design a Superclass
Shape
having three attributes
(Radius, Length, Width)
and three methods(
getRadius( ), getLength( ), getWidth()
) then design another two subclasses extended from Superclass
Shape (1) Circle
having two method
(getArea( ) and toString())
(2)
Rectangle
having two method
(getArea( ) and toString())
Use the following class daigram .
Class Daigram
Super Class Shape
Attributes
private double Radius
private double Length
private double width
Methods
public void getRadius()
public void getLength()
public void getWidth()
Sub class Circle
Attributes
private double Area
Methods
public void getArea( )
public void toString( )
Sub class Rectangle
Attributes
private double Area
Methods
public void getArea( )
public void toString( )
Random Steps
Actions
Proposed Steps
Psedu Code
toString( )-SubClass Rectangle
getRadius( )
getArea( )-SubClass Circle
getWidth( )
Create Sub Class Rectangle
Sub Class Rectangle Attributes
Sub Class Circle Attributes
End Sub Class Rectangle
toString( )-SubClass Circle
End Super Class
End Sub Class Circle
Create Sub Class Circle
Super Class Attributes
Create Super Class
getLength( )
getArea( )-SubClass Rectangle
No of Errors:
Select any step from the first List Box and move it to the second List Box and make all its lines into correct steps of sequential order, using the Arrow Keys
.