// ----------------------(1)
// Name:  McCabe, Micheal H.
// Class 9 Model D Quiz
// 2/9/09
//
// ----------------------(2,3)
// Direct the preprocessor to bring in the standard i/o library
// and the string class library

#include <iostream>
#include <string>

//
// ----------------------(4)
// Establish the name space as standard

using namespace std;

//
// ----------------------(5,6)
// Begin the declaration of the “main” function and
// indicate it returns a whole number (do not forget the “open block” char)
// use two lines:

int main ()
{

//
// ----------------------(7-13)
// Declare the following 7 Variables
// name: “abc”; type: whole number; initial value: 2 <--(7)

float abc=2;

// name: “c”; type: whole number; initial value: 9 <-- (8)

int c=9;

// name: “zebra”; type: whole number; initial value: 0 <-- (9)

int zebra=0;

// name: “equality1”; type: string; initial value: "Greater than ";<-- (10)

string equality1=”Greater than “;

// name: “equality2” ; type: string; initial value: " Less than ";<-- (11)

string equality2=” Less than “;

// name: “temp”; type: whole number; initial value: 0 <-- (12)

int temp=0;

// name: “Answer”; type: string; initial value: null <-- (13)

string Answer=””;

//
// ----------------------(14)
// output "Computer Model D Example" followed by a newline

cout << “Computer Model D Example” << endl;

//
// ----------------------(15)
// output the prompt "Enter a number between 0 and 100: "

cout << “Enter a number between 0 and 100: “;

//
// ----------------------(16)
// Create a loop that will iterate as long as the value in the variable
// “zebra” is greater than or equal to zero (follow indentations)

while (zebra >= 0)

// ----------------------(17)
	// open a statement block (think – what character does this)
	
	{

	// ----------------------(18)
	// input from standard input a value from the user
	
	cin >> zebra;

	// ----------------------(18,19)
	// conditional: test whether zebra is less than zero, if so
	// open a statement block for this case (two lines)
	
	if (zebra <0)
		{

		// ----------------------(20)
		// output "Signal to Stop" followed by a newline
		
		cout << “Signal to Stop” << endl;

		// ----------------------(21)
		// use a single keyword statement to get out of the while loop.
		
		return 0;

		// ----------------------(22)
		// close this statement block
		
		}

	// ----------------------(23,24)
	// the “otherwise” part of the conditional test above
	// it is a single keyword to be followed by an open statement block
	
		
		else 
		{

		// ---------------------(25)
		// set Temp equal to zebra minus Temp
		
		temp = zebra – temp;

		// ----------------------(26)
		// set Temp equal to Temp divided by x
		
		temp = temp / x;

// ----------------------(27)
		// set abc equal to abc times Temp
		
		abc = abc * temp;

// ----------------------(28,29)
		// Test: if abc is greater than the value of x+1 then
		//    set Answer equal to equality1
		 
		if (abc>x+1) Answer = equality1;
		   
// ----------------------(30,31)
		// else if abc is equal to the value of x+1 then
		//    set Answer equal to “ Equal ”
		
		else if (abc=x+1) Answer = “ Equal “;
		   
// ----------------------(32,33)
// otherwise set Answer equal to equality2
		
		else Answer = equality2;
		   
// ----------------------(34)
		// output "The Answer is: " followed by the value of Answer,
		//        followed by a blank space followed by the value in
		//        abc, followed by a newline
		
		cout << “The Answer is: “ << Answer << “ “ << abc << endl;

// ----------------------(35, 36)
// set abc equal to 2 and Temp equal to zero (2 lines)
		
		abc = 2;
		temp = 0;

		// ----------------------(37)
		// prompt using the string: "Enter a number between 0 and 100: "
		
		cout << “Enter a number between 0 and 100: “;

		// ----------------------(38)
		// Close the statement block opened at question 24
		
		}

	// ----------------------(39)
	// Close the while loop statement block opened at question 17
	
	}

// ----------------------(40)
// signal a normal return to the calling function

	Return 0;

// ----------------------(41)
// Close the “main” function declaration


}


