logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Write a recursive function–def humanPyramid(row, column):–that takes as input the row and column number of a person in a human pyramid, then returns the total weight on that person's back.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

 Python ProgrammingAssignment 0402: Human Pyramid

A human pyramid is a way of stacking people vertically in a triangle. With the exception of the people inthe bottom row, each person splits their weight evenly on the two peoplebelow them in the pyramid. For example, in the pyramid above, person Asplits her weight across people B and C, and person H splits his weight –plus the accumulated weight of the people he issupporting –onto people L and M. It can be mighty uncomfortable to be in the bottom row, since you'll have a lot of weight on your back! In this assignment, you willexplore just how much weight that is.Let us assume that everyone in the pyramid weighs exactly 128pounds.

Write a recursive function–def humanPyramid(row, column):–that takes as input the row and column number of a person in a human pyramid, then returns the total weight on that person's back. The row and column are each zero-indexed, so the person at row 0, column 0 is on top of the pyramid, and person M in the above picture is at row 4, column 2.

Your implementation of humanPyramid must be implemented recursively and must not use any loops. You may be surprised how little code is required!

Record a three minute video in which you run the code. Then, present your code. Specifically, answer the following questions:

  • What is the base case of your recursive function?
  • Doeseveryone in the bottom row carry the same weight?

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

527 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

586 Answers

Hire Me
expert
Husnain SaeedComputer science

774 Answers

Hire Me
expert
Atharva PatilComputer science

647 Answers

Hire Me

Get Free Quote!

307 Experts Online