1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
|
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <unistd.h>
#include <conio.h>
using namespace std;
main()
{
int number1, number2; //Variable, math_1
int number3, number4; //Variable, name_and_math_1
int number5=0, number6=0; //Variable, for_loop_1
char fname[20], lname[20]; //Variable, for name storage
char answer, answer1, answer2, answer3; //Variable
char select; //Variable
char sure; //Variable
char secret; //Variable
char junk; //Not sure what this does but it makes things work
//theres some gpl info and stuff here
printf("Please enter your first name:\t"); //Ask user to enter their first name
scanf("%s",&fname); //Read/store first name
printf("Please enter your last name:\t"); //Ask user to enter their last name
scanf("%s",&lname); //Read/store last name
printf("Hi %s",fname); //Say hi
printf(" %s \n",lname); //Im really quite formal, arne't I
top: //Goto destination 1
system("cls"); //Clear screen
printf("Please select a program %s",fname); //Information/instructions
printf("\n1 Some Simple Addition"); //Information/instructions
printf("\n2 Some Simple Addintion That Tells Your Your Name"); //Information/instructions
printf("\n3 Can You Count To One Million?"); //Information/instructions
printf("\n4 *******"); //Information/instructions
printf("\n5 *******"); //Information/instructions
printf("\n6 *******"); //Information/instructions
printf("\n7 *******"); //Information/instructions
printf("\n8 *******"); //Information/instructions
printf("\n9 *******"); //Information/instructions
printf("\n"); //New line
scanf("%c", &answer); //Wait for user input
scanf("%c", &junk); //Not sure what this does but it makes things work
printf("\n"); //New line
switch (answer) //Begin switch statement
{
case '1': //First option
//math_1
system("cls");
cout << "number 1? ";
cin >> number1;
cout << "number 2? ";
cin >> number2;
answer = number1 + number2;
cout << "\nAnswer is " << answer1;
printf("\n");
system ("pause");
printf("\n");
printf("\n");
goto top; //Return to "top:"
break; //End statement
case '2': //Second option
//name_and_math_1
printf("Hi %s \n",fname);
Beep(2000,200); //Tells user that section has finished
system("pause"); //Press (the) ANY key to continue
printf ("Ok, Now for some simple math!!\n"); //Tells the user whats happening
cout << "Number 1? "; //User input number1
cin >> number3; //Take number1 and store it in memory
cout << "Number 2? "; //User input number2
cin >> number4; //Take number2 and store it in memory
answer = number3 + number4; //Add number1 and number2 together
cout << "Answer is " << answer2; //Show answer of above function
Beep(2000,200); //Tells user that section has finished
system ("pause"); //Press (the) ANY key to continue
goto top;
break; //End statement
case '3': //Third option
//for_loop_1
printf("Ok, now it's time for some simple counting.\n");
system("pause");
printf("Can you keep up........\n");
system("pause");
for (number5=0; number5 <1000001; number5++) //number <=10 or number <11
{
printf("%d ", number5);
}
printf("\n");
system ("pause");
break; //End statement
// case '4': //Fourth option
//
//
// break; //End statement
default:
Beep(2000,200); //Tells the user that the comand has been run
Beep(2000,200); //Tells the user that the comand has been run
Beep(2000,200); //Tells the user that the comand has been run
Beep(2000,200); //Tells the user that the comand has been run
Beep(2000,200); //Tells the user that the comand has been run
printf("-__-\n"); //Information/instructions
printf("."); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf("."); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf("."); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf("."); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf("."); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf("."); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf("."); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf(".\n"); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf("Thats not an option\n"); //Information/instructions
printf("."); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf("."); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf(".\n"); //Information/instructions
Sleep (800); //ZzzZzzZzzZzz
printf("Lets try this again........\n"); //Information/instructions
system("pause"); //Press (the) any key to continue
system("cls"); //Clear the screen
goto top; //Return to "top:"
}
}
|