// Progammer Name: Micheal H. McCabe 
// Assignment # and/or Program Name: Program Model A
// Last Edited Date: 2/04/09
//
// What libraries are needed to:
//   use standard I/O streams?
//   use the string class?
// These libraries are retrieved and logicially inserted
// by the 'C' preprocessor. All preprocessor statements
// begin with the "#" character as the first character on a line.
//
// Preprocessor Include Statement Syntax:
//     There are two forms:
//       1.In the first form the initial "<" and final ">" are
//         required;
//       2.In the second the quotes are required. No example is
//         used for the second form in this program.
//    #include < <class library name> >
//    #include "filename"
// Write the proper include statements below.
// <------------------(1)
#include <iostream>
#include <string>

// How do you tell the C++ compiler to use the "standard" namespace?
// Enter the C++ statement that expresses the namespace.
//
// Using Statement Syntax:
//     using namespace <name>;
// <------------------(2)
using namespace std;

// In all 'C' and C++ programs there is a "main" function (in some
// langauges called a procedure, routine, or subroutine).
//
// Function Declaration Syntax:
//      <return data type> <function name> ( <optional parameters> )
//      {
//      <statements>
//      }
// OR
//      <function name> ( <optional parameters> )
//      {
//      <statements>
//      }
// How do you start a function that will be the "main" function?
// <------------------(3)
int main()
{

// Main function description:
// this is the only function for Model A
// It declares the storage and executes the algorithm.
// Inputs: None
// Outputs: 0 on return
//          Standard Output - A value calculated for Box5
// How do you declare an array of eleven boxes and initialize each
// element to: 0,6,3,9,2,11,2,91,48,66,1
//
// Array Declaration Syntax:
//     <data type> <variable name> [ <size> ] = { val1, val2, ..., valx };
//     <data type> <variable name> [ ] = { val1, val2, ..., valx };
//     <data type> <variable name> [ <size> ];
//
// Declare a variable named "Box" that holds eleven whole numbers initialized
// as stated above.
// <------------------(4)
int Box [] = {0,6,3,9,2,11,2,91,48,66,1};

// How do you output to the terminal display (standard output)?
// Output Stream Syntax:
//     cout << <value reference>;
//     cout << <val reference 1> << <val refer. 2> ... << <val refer. k>;
//   where: "<<" is the insertion operator (put to)
//          <value reference> is one of the following:
//                <literal>               e.g. "Hi" or 56
//                <variable name>         e.g. Cost
//                <expression>            e.g. A / B + C
//                <manipulator>           e.g. endl          (means new line)
//
// Output the literal "Computer Model A Example" to the terminal followed by
// a new line instruction (go to the next line down on the terminal).
// <------------------ (5)
cout << "Computer Model A Example" << endl << endl;

// How do I assign values to array elements?
//
// Assignment Statement Syntax:
//       <variable name> = <expression>;
//    where:  <expression> can be
//         <literal>
//         <variable name>
//         <array name> [<element index>]
//         <literal> <arithmetic operator> <expression>
//         <variable name> <arithmetic operator> <expression>
//         <array name> [<element index>] <arithmetic operator> <expression>
//    and <arithmetic operator> is one of:
//         +  -  *   /  %
//
// Set Box7 to the sum of Box4 + Box2 means:
// Set the 8th Box element to the sum of the 5th plus the 3rd Box element.
// Why is Box7 the 8th element? The difference is caused by the fact that
// the first element is element is at index zero:
// <------------------(6)
Box[7]=Box[4] + Box[2];

// Set Box6 equal to the value in Box7 plus the value of the box whose
// number in Box6. This means set the 7th Box element to the sum of
// the 8th element and the element whose Box number is in the 7th Box
// element:
//
// <------------------(7)
Box[6] = Box[7] + Box[Box[6]];

// Set Box5 equal to Box6 times Box1. Means set the 6th box element to
// the 7th Box element times the 2nd box element.
// <------------------(8)
Box[5] = Box[6] * Box[1];

// output the literal "Answer in Box 5 is: " followed by the value in Box5
// (that really indexes of which box element?), followed by a new line:
// <------------------(9)
cout << "Answer in Box 5 is: " << Box[5] << endl;

// End the algorithm by returning a literal value for zero to the caller;
// In this case the caller is the operating system. The value zero means
// a normal return.
//
// Return Statement Syntax:
//    return <expression>;
//    return;         <-- for functions declared with the <data type> "void"
//
// Return a zero:
// <------------------(10)
return 0;

// Put the final clossing waving brace at the end of the function
// being declared. In this case the "main" function.
// <------------------(11)
}

