Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**please note that i posted this question a few hours ago and the answer iv got was incorrect (progrem didnt work the way it should)

**please note that i posted this question a few hours ago and the answer iv got was incorrect (progrem didnt work the way it should) - so please dont copy past that code.

c++

On the island of Akshay in the North Atlantic, there are ten volcanoes arranged in a circle (periodic boundary conditiond - handle it elegantly), To the regret of the islanders - the volcanoes often erupt.

The soil of the island should survive all these eruptions but once three adjacent volcanoes erupt at least five times each (not necessarily at once) the soil wont stand it, the island will collapse and its inhabitants will have to flee. Write a program that will monitor the eruptions of the volcanoes and alert you as soon as three adjacent volcanoes erupted at least five times each. The program must print the volcanoes numbers in order for the islanders know to run the opposite way. In the main of the program there will be a "while" loop that randomly grilling the volcano that will erupt in such a way:

while(){

int mountain_num = rand()%10;

}

Add arrays, functions, and conditions if necessary (of course, for a "while" - conditions must be entered). Once three adjacent volcanoes erupt at least five times each, the plan will print their number and end. The order of the eruption of the volcanoes must also be printed.

Example (for at least three eruptions, not five)

Volcanic eruptions (by volcanoes numbers): 0,8,3,0,9,2,8,4,5,8,0,7,7,4,9,6,8,1,9

volcanoes 8,9,0 experience volcanic eruptions! run away

please try to write simple code (as simple as you can), so ill be able to understand it. thank you so much

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

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions

Question

8. Providing support during instruction.

Answered: 1 week ago