{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# HW03 - Repetitive Control Structures BEE 1510 Introduction...

This preview shows pages 1–4. Sign up to view the full content.

Repetitive Control Structures BEE 1510: Introduction to Computer Programming Homework Exercise 03 Timothy Lin Cornell University due: October 20, 2008

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Executive Summary This exercise was meant to calculate the heart rates of a random population of a given gender and population size. In other words, a probability of distribution is being created to model the expected characteristics of both one person and an entire population based on similar characteristics of others. From there, it is possible to say with some confidence that there are certain percentages and parts of the population that maintain a certain characteristic. In this simulation, for example, the average heart rates. Problem The problem faced is how does a heart manage how much blood is receives and how much it pumps out and how do we look at a general randomized population’s heart rates? Objective The objective for this program is to ask the user for the gender of the population being looked at. Then, the program asks the user for the number of people in the population of the gender chosen, checking to make sure, that for this program’s simulation, the population entered is between 100 and 100,000. The program then will randomize the heart parameters that are given previously, perform a bisection to figure out what actual pressure at the right atrium where the cardiac output equals venous return and then using that pressure, determine the heart rate of the individual. Those individuals are then compiled into a histogram. Materials and Methods The first equation used is located in the function file “cardiac_output.” It is calculated by taking the maximum cardiac output divided by one plus quantity squared actual pressure at the right atrium minus the minimum pressure at the right atrium. The second equation is located in the function file “venous_return.” It is calculated by dividing actual pressure at the right atrium by systemic filling pressure and dividing that by resistance to venous return.
Materials and Methods – algorithm for script 1. Enter Comments BEE 1510 Introduction to Computer Programming Homework Exercise 03: Repetitive Control Structure Timothy Lin TA: Celina This script file first asks for the gender and size of the population to be simulated. Then, for each individual in the population, the heart parameters are randomized. If the difference between the right and left boundary is greater than the tolerance, that means that the intercept has not been found. As the script loops, if the difference is still greater than the tolerance, the script will perform the bisection to find the root of the CO-VR function until the heart rate for the individual is found. Record of revisions: original code: October 8, 2008 last modified: 2. Inputs ask user for gender of population to be simulated (menu command) ask user for input of size of population to be simulated 3. Coding check if input of size of population must be between 100 and 100,000 (if/else statement)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern