Thirty cannibals begin to eat ten missionaries. It takes an hour to eat the firs
ID: 3739289 • Letter: T
Question
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 missionariesExplanation / Answer
#include #include #include using namespace std; int main() { //declare variables int hours,missionaries,tarzan,eaten,day=0,cannibals; double ratio=0,cannleft; //ask for inputs //asking for # of missionaries coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.