Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am trying to write a recursive program in Java. Also, I am trying to count how many times a recursive function is called. human
I am trying to write a recursive program in Java. Also, I am trying to count how many times a recursive function is called.
human pyramid is a way of stacking people vertically in a triangle. With the exception of the people in the bottom row, each person splits their weight evenly on the two people below them in the pyramid. For example, in the pyramid above, the person on the first row is supported by both people on the second row The first person on the last row is supporting half the weight of the person on his left shoulder while the second person on the last row is supporting the other half on his right shoulder, plus he has weight on his left shoulder from the person standing on it. ul Your job is to write a recursive progranm that will display how much weight a person is holding. You can assume that each person weighs 200 pounds. Your program will ask the user for a row and column and your program will display the weight that is being supported by that person. Your program will continue in a loop- asking the user for a row and column until the use enters 0 and 0 for the row and column. www.shutterstock.com 113454715 Here is an example: Welcome to the Human Pyramid. Select a row, column combination and I that person is supporting. Please type your selections for Row and Column: will tell you how much weight > 1 1 // User types 1 for row and 1 for column Person at (1,1) is supporting 0 pounds. Please type your selections for Row and Column: >2 1 // User types 2 for row and 1 for column Person at (2,1) is supporting 100 pounds. Please type your selections for Row and Column: 43 I/ User types 4 for row and 3 for column Person at (4,3) is supporting 425 pounds. Please type your selections for Row and Column: >o0 // User types O for row and O for column Thanks for playing Human Pyramid. Don't let me down! Question: Is there a limit to how tall your pyramid can be Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started