3.3. ExercisesΒΆ
-
Write an equals method for the fraction class that returns true is two fractions are equal and false otherwise.
-
Write sub, mul, and div for the Fraction class.
-
Write a class that represents a Rectangle. Your constructor should take a length and a width. Write an area method that returns the area of the rectangle.
-
Write a class the old way that represents a Rectangle. Your constructor should take a length and a width. Write an area method that returns the area of the rectangle.
-
Write a class
Stack
that implements the stack data type, with a push, pop, peek, size, and isEmpty as the methods.
-
Write a class Cat that inherits from Animal.
You have attempted of activities on this page