Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

1. PricewaterhouseCoopers

Answered: 1 week ago

Question

3. SCC Soft Computer

Answered: 1 week ago