/* geology.cpp:  A program to model rocks
 *
 * Written by:   Larry R. Nyhoff
 * Written for:  Lab Exercise 2A in Lab Manual for 
 *                 C++: An Introduction to Data Structures
 * Modified by:  (your name)
 * ------ Add other documentation ------
 *************************************************************************/

#include <iostream>
using namespace std;

// Represent each rock by a number

const int BASALT = 0;
const int DOLOMITE = 1;
const int GRANITE = 2;
const int LIMESTONE = 3;
const int MARBLE = 4;
const int OBSIDIAN = 5;
const int QUARTZITE = 6;
const int SANDSTONE = 7;
const int ROCK_OVERFLOW = 8;

// Function prototypes go here

int main()
{
  /***** PART 1 ******/

  // Declare a variable to store a rock

  int sample;

  // Input and display various rocks

  for(;;)
  {
    cout << "Enter a rock name (" << ROCK_OVERFLOW << " to stop): ";
    cin >> sample;
    if (sample == ROCK_OVERFLOW) break;
    cout << "Rock is: " << sample << endl;
  }

  /***** PART 2 ******/

  // Display all the rock names

  cout << "\nList of rock names:\n";
  for (int rockVal = BASALT; rockVal <= SANDSTONE; rockVal++)
    cout << rockVal << "  ";
  cout << endl;
}

