// Angles Gary
// file: "atest.cpp"

// Main file for alist
/*
CS245 - CS II Spring 1997 LAB 11


Due by the end of lab(April 15, 1997):

Write a program that

  1.reads in characters until the user enters a *
  2.places them in a list (use the array implementation)
  3.displays the length of the list
  4.and displays the first and next to last elements in the list

NOTE: The array implementation of a list is in ALISTS.H and ALISTS.CPP on
the CS245 share drive on Jaring
*/

#include 
#include "alists.cpp"

void main()
{
	TList Lista;		// creates a list to handle chars
	char Caracter;				// creates a char
	cout << "1.- text in ENGLISH.\n2.- Texto en ESPANOL\n";
	int Lang;
	cin >> Lang;

	if (Lang == 2)                       // in case you chose spanish
		cout<<"\n escriba su letra favorita. ";   // you'll get spanish
	else cout<<"\n enter your favorite character. ";//else the default is english
	cin>> Caracter;   // reads in the character you want to be appended in
	while (Caracter != '*')   // as long as the Caracter is not '*' do
	{
		Lista.Insert(Caracter);   // it inserts Caracter into List
		if (Lang == 2)
			cout<<"\n No te canses, Otra ves. Dime otra letra o * para terminar ";
		else
			cout<<"\n Come on don't get tired. Tell me again or * to finish. ";
		cin>> Caracter;   // enter another Caracter to append
	}

	if (Lang == 2)
		cout<<"\n La longitud de la lista es: "<