Question: JAVA CODE 1.There is a staircase of n steps (n>0), a person standing at the bottom wants to reach the top. The person can climb
JAVA CODE
1.There is a staircase of n steps (n>0), a person standing at the bottom wants to reach the top. The person can climb either 1, 2, or 3 stairs at a time. Count the number of distinct ways, the person can reach the top.
You need to write a function using recursion and a test program, that will produce the answer for any number of steps given by the user (input from terminal). Please also explain your recursive method.
2. Define a max method which can compare two geometric objects and return the larger one on the basis of area. Write a test program to use this method for: a) two circles, b) two rectangles, and c) one circle and one rectangle.
Sample outpput:
The max of [Circle](5.0) and [Circle](5.6) is [Circle](5.6)
The max of [Rectangle](5.0,15.0) and [Rectangle](10.0,10.0) is [Rectangle](10.0,10.0)
The max of [Circle](5.0) and [Rectangle](5.0,15.0) is [Circle](5.0)
The max of [Circle](5.6) and [Rectangle](10.0,10.0) is [Rectangle](10.0,10.0)
Classes for GeometricObject, Circle, and Rectangle are attached, but you need to modify them first to fit this task.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
