<p>You are taking a geology class, and the professor wants you to write a progra
ID: 3635677 • Letter: #
Question
<p>You are taking a geology class, and the professor wants you to write a program to help students learn the periods of geologic time. The program should let the user enter a range of prehistoric dates (in millions of years), and then output the periods that are included in that range. Each time this output is done, the user is asked if he or she wants to continue. The goal of he exercise is for students to try to figure out when each period began, so that he or she can make a chart of geologic time.<br />Within the program, represent the periods with an enumeration type made up of their names. You will probably want to create a function that determines the period corresponding to a date, and another function that returns the string corresponding to each identifier in the enumeration. Then you can use a For loop to output the series of periods in the range. The periods of geologic time are given here:<br />Period name Starting date (millions of years)<br />Neogene 23<br />Paleogene 65<br />Cretaceous 136<br />Jurassic 192<br />Triassic 225<br />Permian 280<br />Carboniferous 345<br />Devonian 395<br />Silurian 435<br />Ordovician 500<br />Cambrian 570<br />Precambrian 4500 or earlier</p>Explanation / Answer
#include #include using namespace std; void printResults(int); void getRange(); enum Periods {NEOGENE, PALEOGENE, CRETACEOUS, JURASSIC, TRIASSIC, PERMIAN, CARBONIFEROUS, DEVONIAN, SILURIAN, ORDOVICIAN, CAMBRIAN, PRECAMBRIAN}; int main() { bool goAgain = true; Periods finRange; int range[2]; while(goAgain) { range = getRange(); printResults(range); goAgain = askAgain(); } system ("pause"); return 0; } void printResults(int finRange); { 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.