|
Mrs. Ruiz-Houston
|
|
|
Computer Competition Level 3 Question #3.1 3.2 A flea, usually less than an eighth of an inch long, can long jump about 13 inches and high jump about 8 inches. If humans could jump in proportion to the flea, it would take only about nine leaps to go one mile! You are going to determine
how FAR a human could jump if they had the proportionate strength of the flea. Given: 5280 feet in 1 mile
· Write a program that prompts you for the knowns, and outputs the unknowns. · Allow the user to enter horizontal distance (miles). · Allow the program to take the input “x” as the “solve for” value to calculate. · Allow for decimals. Accuracy only necessary to 0.1 decimal places (i.e. 7.2, 88.9, etc). · NOTE: Program should not allow incorrect data entry…report ERROR, and restart. · Assume no combination of H and V…just travel horizontally or vertically. · Assume no effects of gravity (ignore weight), and assume world is flat. · 13inches / (1/8inches) = 104inches = which is the multiplier · Calculate out the conversions of the person’s height vs. their total jumping length. · Calculate out the mile to feet conversion. A flea at 1/8 inch=0.125inches so distance it can jump vs. its height 13 / 0.125= multiplier. Solve for multiplier= 104. Example: a 6 foot person could jump 104 times its length = 624 feet/jump = 1-jump. For 1 mile: (5280 feet/mile) / (624 feet/jump) = 8.46 jumps/mile. FORMAT: Prompt: Enter your height in feet: ? Prompt: Enter type of direction (H): ? Prompt: Enter distance to travel out in miles: ? Prompt: Enter number of jumps: ? Output: Your height in feet: Output: Type of direction: Output: Distance traveled out in miles: Output: Number of jumps: Example: Enter your height in feet: 6 Enter type of direction (H): H Enter distance to travel out in miles: 1 Enter number of jumps: X Your height in feet: 6 Type of direction: H Distance traveled out in miles: 1 Number of jumps: 8.5 JUDGES: Realize maximum horizontal distance for flea = 13inches. 5280 feet in 1 mile; Determine how far a human could jump on a single leap with this strength, then determine the number of leaps to take. Remember, you are concerned with the size of the flea to determine what the rate of jumping proportion is: A flea at 1/8 inch=0.125inches so distance it can jump vs. its height 13 / 0.125= multiplier. Solve for multiplier= 104. Example: a 6 foot person could jump 104 times its length = 624 feet/jump = 1-jump. For 1 mile: (5280 feet/mile) / (624 feet/jump) = 8.46 jumps/mile. For 2.2 miles: 5280 x 2.2=11616 feet Therefore: 11616 / 624 = 18.6 leaps Example: a 7 foot person could jump 104 times its length = 728 feet/jump = 1-jump. For 1 mile: (5280 feet/mile) / (728 feet/jump) = 7.25 jumps/mile. 50.8 leaps x 728 = 36960 36960 / 5280 = 7 miles Example: a 4 foot person could jump 104 times its length = 416 feet/jump = 1-jump. For 1 mile: (5280 feet/mile) / (416 feet/jump) = 12.69 jumps/mile. For 5 miles: 5280 x 5=26400 feet Therefore: 26400 / 416 = 63.5 leaps Example: a 12 foot person could jump 104 times its length = 1248 feet/jump = 1-jump. For 1 mile: (5280 feet/mile) / (1248 feet/jump) = 4.23 jumps/mile. 2.11 x 1248 = 2640 2640 / 5280 = 0.5 miles RUN / OUTPUT Enter your height in feet: 6 Enter type of direction (H): H Enter distance to travel out in miles: 2.2 Enter number of jumps: x Your height in feet: 6 Type of direction: H Distance traveled out in miles: 2.2 Number of jumps: 18.6 (the program calculated this value) Enter your height in feet: 7 Enter type of direction (H): H Enter distance to travel out in miles: x Enter number of jumps: 50.8 Your height in feet: 7 Type of direction: H Distance traveled out in miles: 7 Number of jumps: 50.8 RE-TRY Enter your height in feet: 4 Enter type of direction (H): H Enter distance to travel out in miles: 0 Enter number of jumps: x ERROR Your height in feet: 4 Type of direction: H Distance traveled out in miles: 5 Number of jumps: 63.5 Enter your height in feet: 12 Enter type of direction (H): H Enter distance to travel out in miles: x Enter number of jumps: 2.11 Your height in feet: 12 Type of direction: H Distance traveled out in miles: 0.5 Number of jumps: 2.11 |