Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Thirty cannibals begin to eat ten missionaries. It takes an hour to eat the first missionary. After each missionary is eaten, one cannibal steals away
Thirty cannibals begin to eat ten missionaries. It takes an hour to eat the first missionary. After each missionary is eaten, one cannibal steals away into the forest. Each cannibal eats at a constant rate Therefore, since there are fewer consumers (cannibals), fewer missionaries will be consumed in each hour Fortunately for the missionaries help is on the way. Tarzan is coming!!! However, he is 80 miles away. During the day Tarzan travels at seven miles per hour. During the darkness Tarzan reduces his speed (gotta watch out for those trees) to 4 miles per hour. Darkness lasts nine hours. When the cannibals start eating, there are only 3 hours of light left. Problem: Write a program to calculate and display how many cannibals will be caught and how many missionaries will be saved. Display your results in the following form Missionaries Left Tarzan Distance 80 73 ur 30 29 Consider that a missionary partially consumed is not a missionary saved Extra, Extra Credit Challenge Change your program so that a single cannibal still eats at a rate of 1/30 of a missionary per hour, BUT the program will prompt the user for the number of missionaries, the number of cannibals, and the distance Tarzan needs to travel. In other words your prog cannibals (no more than 30) and Tarzan's distance ram should be general enough to handle any values for missionaries
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