// Ryans Homework.cpp : Defines the entry point for the console application. // #include "stdafx.h" //Ryan Weber Program 0 # include #include using namespace std; using std::ofstream; int counter=0; char ch; int lnct=0; int chct=0; const int DefaultListSize=100; typedef char Elem; class Astack { private: int size; int top; Elem *listArray; public: Astack(int sz =DefaultListSize) { size=sz; top=0; listArray=new Elem[sz]; } ~Astack() {delete [] listArray;} void clear() {top=0;} bool push(const Elem& item) { if (top == size) return false; else { listArray[top++] = item; return true;} } bool pop(Elem& it) { if (top==0) return false; else{ it=listArray[--top]; return true; } } bool topValue(Elem& it) const { if (top == 0) return false; else { it = listArray[top-1]; return true;} } int length() const {return top;} bool IsEmpty() const {return (top==0);} }; int main() { while((ch=cin.get())!=EOF) { if (ch!='\n') { chct++; cout<< ch << " "; cout<<"The number of characters is: " << chct << endl; } else { lnct++; cout<