#include #include #include using namespace std; int main(void) { string com; menu: cout << ">"; cin >> com; if (com == "demo") { cout << "\n\nYou have reached the internal demo! Huzzah!\n"; goto menu; } else if (com == "DEMO") { cout << "\n\nYou have reached the internal demo! Huzzah!\n"; goto menu; } else if (com == "numio") { int numin; cout << "\nPlease enter a number: "; cin >> numin; int numout = (numin * 3 / 2 + 99 - 65); cout << numout << "\n\n"; goto menu; } else if (com == "NUMIO") { int numin; cout << "\nPlease enter a number: "; cin >> numin; int numout = (numin * 3 / 2 + 99 - 65); cout << numout << "\n\n"; goto menu; } else if (com == "\\") { goto menu; } else if (com == "/") { goto menu; } else if (com == "help") { cout << "Commands:\n\nhelp This.\nnumio Number Input/Output machine.\necho Repeats a line of input.\nshell Initiates the user interface.\nclear Clears the screen.\ncls Same as \"clear\".\n"; goto menu; } else if (com == "echo") { string echo; cout << "What phrase/word shall I repeat? "; cin >> echo; cout << endl << echo.c_str() << endl; goto menu; } else if (com == "ECHO") { string echo; cout << "What phrase/word shall I repeat? "; cin >> echo; cout << endl << echo.c_str() << endl; goto menu; } else if (com == "HELP") { cout << "Commands:\n\nhelp This.\nnumio Number Input/Output machine.\necho Repeats a line of input.\nshell Initiates the user interface.\nclear Clears the screen.\ncls Same as \"clear\".\n"; goto menu; } else if (com == "shell") { shmenu: system("CLS"); cout << "Welcome to the AIOT TUI(Text User Interface) Shell.\n\n\n"; int response = 0; do { cout << "Shell Main Menu\n\n" << "[1] Use AIOT Tutorial\n" << "[2] Get a circle\'s full dimensions\n" << "[3] Return to the command interpreter\n"; cin >> response; } while (response < 1 || response > 3); if (response == 1) { cout << "\n\nWelcome to the AIOT Tutorial.\n\nTo start using AIOT, your first command would have been shell,\nif you got here before using any other commands. AIOT is a command interpreter,\nusing internal commands to keep easy use for the user.\n\nAIOT was officially started on November 26th, 2005.\nThe simple commands are tutorialless,\nbut the advanced commands (echoboot, etc.) have tutorials.\n\n" << "Your first important command shall be \"numio\". Type \"numio\" at the prompt, and\npress enter. You will be asked for a number. Type a number of\nyour choice, and press enter. If your number is 1, the output will be 35.\nIf your number is 45, you will get an output of 101.\n\nNext, you will use \"echo\". type \"echo\" at the command prompt, and type a word\nor phrase.\nThe program will repeat your input.\n\nThere! You have mastered two commands!(Three, for getting here:p)\n\nTo access the advanced tutorials, type \"advtutor\".\n\n\n"; system("PAUSE"); goto shmenu; } else if (response == 2) { typedef float f; const f PI = 3.141592; f radius, circumference, area; cout << "Welcome to the \"Radius 2 Full\" circle generator!\n" << "What would you like the radius to be? "; cin >> radius; area = PI * radius * radius; circumference = PI * (radius * 2); cout << "The area of the circle is " << area << ".\n"; cout << "The circumference is " << circumference << ".\n\n\n"; system("PAUSE"); goto shmenu; } else goto menu; } else if (com == "SHELL") { shmenu2: system("CLS"); cout << "Welcome to the AIOT TUI(Text User Interface) Shell.\n\n\n"; int response = 0; do { cout << "Shell Main Menu\n\n" << "[1] Use AIOT Tutorial\n" << "[2] Get a circle\'s full dimensions\n" << "[3] Return to the command interpreter\n"; cin >> response; } while (response < 1 || response > 3); if (response == 1) { cout << "\n\nWelcome to the AIOT Tutorial.\n\nTo start using AIOT, your first command would have been shell,\nif you got here before using any other commands. AIOT is a command interpreter,\nusing internal commands to keep easy use for the user.\n\nAIOT was officially started on November 26th, 2005.\nThe simple commands are tutorialless,\nbut the advanced commands (echoboot, etc.(non-existant yet)) have tutorials.\n\n" << "Your first important command shall be \"numio\". Type \"numio\" at the prompt, and\npress enter. You will be asked for a number. Type a number of\nyour choice, and press enter. If your number is 1, the output will be 35.\nIf your number is 45, you will get an output of 101.\n\nNext, you will use \"echo\". type \"echo\" at the command prompt, and type a word\nor phrase. The program will repeat your input.\n\nThere! You have mastered two commands!(Three, for getting here:p)\n\nTo access the advanced tutorials, type \"advtutor\".\n\n\n"; system("PAUSE"); goto shmenu2; } else if (response == 2) { typedef float f; const f PI = 3.141592; f radius, circumference, area; cout << "Welcome to the \"Radius 2 Full\" circle generator!\n" << "What would you like the radius to be? "; cin >> radius; area = PI * radius * radius; circumference = PI * (radius * 2); cout << "The area of the circle is " << area << ".\n"; cout << "The circumference is " << circumference << ".\n\n\n"; system("PAUSE"); goto shmenu2; } else goto menu; } else if (com == "clear") { system("CLS"); goto menu; } else if (com == "CLEAR") { system("CLS"); goto menu; } else if (com == "cls") { system("CLS"); goto menu; } else if (com == "CLS") { system("CLS"); goto menu; } else if (com == "advtutor") { cout << "Nothing now!\n"; system("PAUSE"); goto menu; } else if (com == "ADVTUTOR") { cout << "Nothing now!\n"; system("PAUSE"); goto menu; } else if (com == "exit") { goto exit; } else if (com == "EXIT") { goto exit; } else { cout << "Your input is not a command/file name.\n"; goto menu; }; exit: return 0; }