//Allan Clark Alyxpres.cpp// //Oct 21/02// //This program will calculate a bunch of numbers in 0.5 increments// #include //The library call for input/output// #include #include //The library call for input/output manipulation// #include //The library call for clrscr()// #include //The library call used to manipulate string variables. (strcpy)// #include //The library call to use math equations (sqrt) // #include //The library call to acquire the system's date// int main(void) { char yes; // Declaration of Local Variables // do { double increment, refbegin, refend, sqrx, x, y; //Fowler Statement// cout << endl << endl; cout << " ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*" << endl; cout << " ~This program will calculate a bunch of numbers in 0.5 increments*" << endl; cout << " ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*" << endl; cout << endl; cout << " // Allan Clark - Programmer //" << endl << endl; cout << " Press Any Key to Continue"; getch(); // gets character // start: clrscr(); //Clears the fowler screen and goes to the input screen// time_t t=time(NULL); cout << "\t" << ctime(&t)<< endl << endl; //Displays the time// cout << endl << endl; cout << "\t\tY Expression" << endl; cout << "\t\t~~~~~~~~~~~~" << endl; cout << endl; cout << "What is the beginning reference in the range of (-.2.5 to 3.5): "; cin >> refbegin; cout << endl << endl; cout << "What is the ending reference in the range of (-.2.5 to 3.5): "; cin >> refend; cout << endl << endl; clrscr(); cout << "\t" << ctime(&t)<< endl << endl; //Displays the time// cout << " \t\t Functions and Relations" << endl; cout << " \t\t ~~~~~~~~~~~~~~~~~~~~~~~" << endl << endl; cout << " Value of 'X' \t\ty = -2x^2 + 3x + 1 " << endl; cout << " ~~~~~~~~~~~~ \t\t~~~~~~~~~~~~~~~~~~ " << endl; increment = 0.5; for(x = refbegin; x <= refend; x = x + increment) { sqrx = x * x; // Squares 'X' y = (-2 * sqrx) + (3 * x) + 1; // calculate the function values calculated by the expression cout << setiosflags(ios:: fixed | ios:: right); cout << setprecision(1); cout << setw(10) << x << setw(30) << y; getch(); cout << endl; } cout << endl << "\t\t\t !! * Thank You * !!" << endl << endl; cout << "\t Do you wish to make another report? (y/n): "; cin >> yes; } while(yes != 'n'); if(yes != 'y') // If statement that asks user if (s)he wants to make another report // { _exit(0); } }