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
getArea( )-SubClass Circle
getWidth( )
toString( )-SubClass Rectangle
End Super Class
toString( )-SubClass Circle
Sub Class Rectangle Attributes
getLength( )
getArea( )-SubClass Rectangle
Super Class Attributes
End Sub Class Rectangle
getRadius( )
Create Sub Class Rectangle
Create Sub Class Circle
Create Super Class
Sub Class Circle Attributes
End Sub Class Circle
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
.