Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using c++ and the while loop, no input from the user is needed. When the cannibals first eating there is 3 hours left of daylight,

Using c++ and the while loop, no input from the user is needed. When the cannibals first eating there is 3 hours left of daylight, so for the first 3 hours tarzan is moving at 7 mph, after the the 3 hours it turns dark for 9 hours, which tarzan moves at a speed of 4 mph, then once the 9 hours is done there is then 15 hours of daylight. The constant rate of how fast cannibals eats one missionary is 0.033 * Cannibals. Once one full missionary is eaten then one cannibal leaves, so once the missionary # goes down one whole number for example from 9 to 8 then one canibal leaves. Can you please help me write a program in c++ using a while loop.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

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions