Sup, I'm writing a program that sort of combines all of the programs from my computer class into one big program, along with other programs I have invented. I was just wondering if anyone had any suggestions for my program. Like any programs that I can add, any way to make my program more efficient... etc. I'm sort of looking for stuff to add eg. a password system(which I have). I only request that you do not point out that goto operations are bad... they are staying. Anyone that helps me out with this program will get recognition on my site and in my program (not much of an incentive, but you should get a war, fuzzy feeling inside for helping out).
Here is my code (PS: The ASCII banners are screwed up because of the copy and paste... just try to look around them)
//ALL-IN-ONE PROGRAM DESIGNED BY CONNOR SPANGLER
//LAST UPDATED 11/29/07
//VERSION - 2.0
//TO DO LIST: INCLUDE WEIGHT CONVERSION PROG AND CURRENCY CONVERSION PROG...
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <string.h>
int main()
{
{
int password;
int numtries = 0;
{
cout << "PLEASE TYPE IN THE PASSWORD...\nPASSWORD: ";
password:
cin >> password;
cerr << "LOGGING IN";
sleep(1);
cerr << ".";
sleep(1);
cerr << ".";
sleep(1);
cerr << ".\n";
sleep(1);
if (password == 2090407)
{
cout << "PASSWORD VERIFIED...\n";
goto verystart;
}
else
{
numtries = numtries + 1;
if (numtries == 5)
{
cout << "PASSWORD DENIED...\nSYSTEM LOGGING OUT...\n";
return 0;
}
}
cout << "PASSWORD DENIED, PLEASE TRY AGAIN...\n";
goto password;
}
{
verystart:
cout << " WELCOME TO THE\n";
cout << " ### #### ####### ######## ######## ####### ###### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ######## ######## ## ## ## \n";
cout << " ######### ## ## ## ## ## ## ## ## ## #### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## #### ####### ## ## ## ####### ###### \n";
restart:
cout << "\n";
cout << "TYPE 1 FOR THE NUCLEAR PROGRAM...\n";
cout << "TYPE 2 FOR THE TRANSPORTATION PROGRAM...\n";
cout << "TYPE 3 FOR THE SPEED TICKET PROGRAM...\n";
cout << "TYPE 4 FOR THE SURVEYING PROGRAM...\n";
cout << "TYPE 5 FOR THE SALES TAX PROGRAM...\n";
cout << "TYPE 6 FOR THE BOX VOLUME PROGRAM...\n";
cout << "TYPE 7 FOR THE RESTAURANT PROGRAM...\n";
cout << "TYPE 8 FOR THE ROCK PAPER SCISSORS PROGRAM...\n";
cout << "TYPE 9 FOR THE PROGRAM MANAGER PROGRAM...\n";
cout << "TYPE 10 TO QUIT THE PROGRAM...\n";
start:
int choice = 0;
cin >> choice;
if (choice == 1)
goto nuke;
if (choice == 2)
goto trans;
if (choice == 3)
goto speed;
if (choice == 4)
goto survey;
if (choice == 5)
goto sales;
if (choice == 6)
goto volbox;
if (choice == 7)
goto food;
if (choice == 8)
goto rps;
if (choice == 9)
goto progm;
if (choice == 10)
goto end;
else
cout << "SORRY, THAT IS NOT ONE OF THE CHOICES... PLEASE TRY AGAIN.\n";
goto start;
}
{
//NUCLEAR PROGRAM
double numberofnukes;
double totalprice;
char country [10];
char place [20];
char typeofnuke [30];
nuke:
cerr << " WELCOME TO THE NUKES R' US\n";
cout << " ## ## ## ## ###### ## ######## ### ######## \n";
cout << " ### ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " #### ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ###### ## ## ######## \n";
cout << " ## #### ## ## ## ## ## ######### ## ## \n";
cout << " ## ### ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ####### ###### ######## ######## ## ## ## ## \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
cerr << "What type of nuke would you like:\n";
cerr << "A mega, ultra, super, or grande bomb?\n";
cin >> typeofnuke;
cerr << "You have chosen a "<< typeofnuke <<" bomb!\n";
cerr << "Enter the number of " << typeofnuke << " nukes you would like to purchase: ";
cin >> numberofnukes;
totalprice = (numberofnukes * 20) + (numberofnukes * 20) * .05;
cerr << "Your total will be $" << totalprice << " with shipping and handling.\n";
cerr << "Would you like to have your nuke launched directly to a country?\n";
cin >> country;
if (strcmp( country, "yes") == 0)
{
cout << "Ok, which country?\n";
cin >> place;
}
else
{
cout << "OK, your nukes will be FedExed to you. They should arrive within one buisness day. Thank you!\n";
goto restart;
}
cerr << "Your nuke has been sent to... " << place << "!!!\n";
cerr << "The nuke will hit " << place << " in 10 seconds...\n";
sleep(1);
cerr << "10\n";
sleep(1);
cerr << "9\n";
sleep(1);
cerr << "8\n";
sleep(1);
cerr << "7\n";
sleep(1);
cerr << "6\n";
sleep(1);
cerr << "5\n";
sleep(1);
cerr << "4\n";
sleep(1);
cerr << "3\n";
sleep(1);
cerr << "2\n";
sleep(1);
cerr << "1\n";
sleep(1);
cerr << "0\n";
sleep(1);
srand ( time(NULL) );
printf ("%d people dead \n", rand() % 9102785);
srand ( 1 );
cerr << "Have a nice armaggedon!\n";
goto restart;
}
{
//TRANSPORTATION
trans:
cout << " ######## ######## ### ## ## ###### #### ######## \n";
cout << " ## ## ## ## ## ### ## ## ## ## ## \n";
cout << " ## ## ## ## ## #### ## ## ## ## \n";
cout << " ## ######## ## ## ## ## ## ###### ## ## \n";
cout << " ## ## ## ######### ## #### ## ## ## \n";
cout << " ## ## ## ## ## ## ### ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ###### #### ## \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
int numvan = 0;
int numpeople = 0;
int numleftover = 0;
cout << "Each bus holds 50 people. \n";
cout << "Each van holds 5 people. \n";
cout << "Enter the number of people that need a ride: \n";
cin >> numpeople;
numleftover = numpeople % 50;
numvan =numleftover / 5;
cout << "The number of buses needed = " << numpeople / 50 << "\n";
cout << "The number of vans needed = " << numvan + 1 << "\n";
goto restart;
}
{
//SPEED TICKET
speed:
cout << " ######## #### ###### ## ## ######## ######## \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## \n";
cout << " ## ## ## ##### ###### ## \n";
cout << " ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ## #### ###### ## ## ######## ## \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
long int speedcar = 0;
const int FINE = 100;
long int totalfine = 0;
cout << "The speed limit is 60 mph, enter the speed of the car: \n";
cin >> speedcar;
totalfine = FINE + ((speedcar - 60) * 10);
cout << "The total fine is $" << totalfine << ".\n";
goto restart;
}
{
//SURVEYING
survey:
cout << " ## ## ######## ### ###### ## ## ######## ########\n";
cout << " ### ### ## ## ## ## ## ## ## ## ## ## \n";
cout << " #### #### ## ## ## ## ## ## ## ## ## \n";
cout << " ## ### ## ###### ## ## ###### ## ## ######## ###### \n";
cout << " ## ## ## ######### ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ######## ## ## ###### ####### ## ## ########\n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
double temperature = 0.0;
double measuredL = 0.0;
double correction = 0.0;
double newlength;
cout << "Input the current tempurature in Fahrenheit:\n";
cin >> temperature;
cout << "Input the length you measured in inches:\n";
cin >> measuredL;
correction = 0.0000116 * (temperature - 20.0) * measuredL;
newlength = measuredL + correction;
cout << "The correct measured length is " << newlength << ".\n";
goto restart;
}
{
//SALES TAX
sales:
cout << " ####### ### ## ######## ###### \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## \n";
cout << " ###### ######### ## ###### ###### \n";
cout << " ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ###### ## ## ######## ######## ###### \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
float priceitem = 0.0;
float salestax = 0.0;
float totalcost = 0.0;
cout << "What is the sales tax where you liv (ex: .07, .08 etc.):\n";
cin >> salestax;
cout << "What is the price of the item you would like to buy:\n";
cin >> priceitem;
totalcost = priceitem + (priceitem * salestax);
cout << "The total price of your item is " << totalcost << ".\n";
goto restart;
}
{
//BOX VOLUME
volbox:
cout << " ## ## ####### ## ## ## ## ## ######## \n";
cout << " ## ## ## ## ## ## ## ### ### ## \n";
cout << " ## ## ## ## ## ## ## #### #### ## \n";
cout << " ## ## ## ## ## ## ## ## ### ## ###### \n";
cout << " ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## \n";
cout << " ### ####### ######## ####### ## ## ######## \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
int sidea = 0;
int sideb = 0;
int sidec = 0;
int totalvol = 0;
char units [10];
cout << "What are you measuring in (inches, feet, yards, etc.)?\n";
cin >> units;
cout << "How many " << units << " is the first side?\n";
cin >> sidea;
cout << "How many " << units << " is the second side?\n";
cin >> sideb;
cout << "How many " << units << " is third side?\n";
cin >> sidec;
totalvol = sidea * sideb * sidec;
cout << "The volume of the box is " << totalvol << " " << units <<" cubed.\n";
goto restart;
}
{
//RESTAURANT
food:
cout << " ######## ### ###### ######## ######## ####### ####### ########\n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ###### ## ## ###### ## ###### ## ## ## ## ## ## \n";
cout << " ## ######### ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ###### ## ## ####### ####### ####### \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
int hamburgers = 0;
int fries = 0;
int sodas = 0;
char typesodas [10];
int cookies = 0;
char typecookies [10];
int appleturnovers = 0;
int salads = 0;
double foodprice = 0;
cout << " MENU:\n";
cout << "Hamburger------------------ $2.00\n";
cout << "Soda----------------------- $1.00\n";
cout << "Cookie--------------------- $1.00\n";
cout << "Apple-turnover------------- $1.75\n";
cout << "Salad---------------------- $1.50\n";
cout << "How many hamburgers would you like?\n";
cin >> hamburgers;
cout << "How many fries would you like?\n";
cin >> fries;
cout << "How many sodas would you like?\n";
cin >> sodas;
cout << "What kind of soda?\n";
cin >> typesodas;
cout << "How many cookies would you like?\n";
cin >> cookies;
cout << "What type of cookie would you like?\n";
cin >> typecookies;
cout << "How many apple-turnovers would you like?\n";
cin >> appleturnovers;
cout << "How many salads would you like?\n";
cin >> salads;
cout << "You have ordered: " << hamburgers << " hamburgers, " << fries << " fries, " << sodas << " " << typesodas << "s, " << cookies << " " << typecookies << " cookies, " << appleturnovers << " appleturnovers, and " << salads << " salads.\n";
foodprice = (hamburgers * 2.00) + (fries * 1.00) + (sodas * 1.00) + (cookies * 1.00) + (appleturnovers * 1.75) + (salads * 1.50);
cout << "Your total will be $" << foodprice << ". Thank you!\n";
goto restart;
}
{
//Rock, Paper, Scissors
rps:
cout << " ######## ####### ###### ## ## \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## \n";
cout << " ######## ## ## ## ##### \n";
cout << " ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ## ## ####### ###### ## ## \n";
cout << " \n";
cout << " ######## ### ######## ######## ######## \n";
cout << " ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## \n";
cout << " ######## ## ## ######## ###### ######## \n";
cout << " ## ######### ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ######## ## ## \n";
cout << " \n";
cout << " ###### ###### #### ###### ###### ####### ######## ###### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## \n";
cout << " ###### ## ## ###### ###### ## ## ######## ###### \n";
cout << " ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ###### ###### #### ###### ###### ####### ## ## ###### \n";
rpstart:
int choice;
int compguess;
const int ROCK = 1;
const int PAPER = 2;
const int SCISSORS = 3;
{
srand((unsigned)time(0));
for(int index=0; index<1; index++)
compguess = (rand()%3)+1;
}
cout << "Type 1 for Rock, 2 for Paper, or 3 for Scissors...\n";
cin >> choice;
switch (choice)
{
case ROCK:
if (compguess == ROCK)
cout << "You = Rock Computer = Rock\nIt's a tie!\n";
else if (compguess == PAPER)
cout << "You = Rock Computer = Paper\nComputer wins!\n";
else
cout << "You = Rock Computer = Scissors\nYou win!\n";
break;
case PAPER:
if (compguess == ROCK)
cout << "You = Paper Computer = Rock\nYou win!!\n";
else if (compguess == PAPER)
cout << "You = Paper Computer = Paper\nIt's a tie!\n";
else
cout << "You = Paper Computer = Scissors\nComputer wins!\n";
break;
case SCISSORS:
if (compguess == ROCK)
cout << "You = Scissors Computer = Rock\nComputer wins!\n";
else if (compguess == PAPER)
cout << "You = Scissors Computer = Paper\nYou win!\n";
else
cout << "You = Scissors Computer = Scissors\nIt's a tie!\n";
break;
default:
cout << "That's not a choice, please try again...\n";
goto rpstart;
}
goto restart;
}
{
progm:
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
cout << " ## ## ### ## ## ### ###### ######## ######## \n";
cout << " ### ### ## ## ### ## ## ## ## ## ## ## ## \n";
cout << " #### #### ## ## #### ## ## ## ## ## ## ## \n";
cout << " ## ### ## ## ## ## ## ## ## ## ## #### ###### ######## \n";
cout << " ## ## ######### ## #### ######### ## ## ## ## ## \n";
cout << " ## ## ## ## ## ### ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ###### ######## ## ##\n";
int decision;
choicea:
cout << "TYPE IN THE NUMBER OF THE PROGRAM YOU WOULD LIKE TO OPEN...\n";
cout << "1 = FIREFOX 2 = ICHAT 3 = FLIGHTGEAR 4 = VLC 5 = ITUNES\n";
cin >> decision;
switch (decision)
{
case 1:
system("open /Applications/Firefox.app");
break;
case 2:
system("open /Applications/iChat.app");
break;
case 3:
system("open /Applications/Flightgear/Flightgear.app");
break;
case 4:
system("open /Applications/VLC.app");
break;
case 5:
system("open /Applications/iTunes.app");
break;
default:
{
cout << "SORRY, THAT IS NOT ONE OF THE OPTIONS...\nPLEASE CHOOSE A VALID CHOICE...\n";
goto choicea;
}
}
goto restart;
}
}
{
end:
cerr << "SYSTEM LOGGING OUT";
sleep(1);
cerr << ".";
sleep(1);
cerr << ".";
sleep(1);
cerr << ".\n";
sleep(1);
return 0;
}
}
Here is my code (PS: The ASCII banners are screwed up because of the copy and paste... just try to look around them)
//ALL-IN-ONE PROGRAM DESIGNED BY CONNOR SPANGLER
//LAST UPDATED 11/29/07
//VERSION - 2.0
//TO DO LIST: INCLUDE WEIGHT CONVERSION PROG AND CURRENCY CONVERSION PROG...
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <string.h>
int main()
{
{
int password;
int numtries = 0;
{
cout << "PLEASE TYPE IN THE PASSWORD...\nPASSWORD: ";
password:
cin >> password;
cerr << "LOGGING IN";
sleep(1);
cerr << ".";
sleep(1);
cerr << ".";
sleep(1);
cerr << ".\n";
sleep(1);
if (password == 2090407)
{
cout << "PASSWORD VERIFIED...\n";
goto verystart;
}
else
{
numtries = numtries + 1;
if (numtries == 5)
{
cout << "PASSWORD DENIED...\nSYSTEM LOGGING OUT...\n";
return 0;
}
}
cout << "PASSWORD DENIED, PLEASE TRY AGAIN...\n";
goto password;
}
{
verystart:
cout << " WELCOME TO THE\n";
cout << " ### #### ####### ######## ######## ####### ###### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ######## ######## ## ## ## \n";
cout << " ######### ## ## ## ## ## ## ## ## ## #### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## #### ####### ## ## ## ####### ###### \n";
restart:
cout << "\n";
cout << "TYPE 1 FOR THE NUCLEAR PROGRAM...\n";
cout << "TYPE 2 FOR THE TRANSPORTATION PROGRAM...\n";
cout << "TYPE 3 FOR THE SPEED TICKET PROGRAM...\n";
cout << "TYPE 4 FOR THE SURVEYING PROGRAM...\n";
cout << "TYPE 5 FOR THE SALES TAX PROGRAM...\n";
cout << "TYPE 6 FOR THE BOX VOLUME PROGRAM...\n";
cout << "TYPE 7 FOR THE RESTAURANT PROGRAM...\n";
cout << "TYPE 8 FOR THE ROCK PAPER SCISSORS PROGRAM...\n";
cout << "TYPE 9 FOR THE PROGRAM MANAGER PROGRAM...\n";
cout << "TYPE 10 TO QUIT THE PROGRAM...\n";
start:
int choice = 0;
cin >> choice;
if (choice == 1)
goto nuke;
if (choice == 2)
goto trans;
if (choice == 3)
goto speed;
if (choice == 4)
goto survey;
if (choice == 5)
goto sales;
if (choice == 6)
goto volbox;
if (choice == 7)
goto food;
if (choice == 8)
goto rps;
if (choice == 9)
goto progm;
if (choice == 10)
goto end;
else
cout << "SORRY, THAT IS NOT ONE OF THE CHOICES... PLEASE TRY AGAIN.\n";
goto start;
}
{
//NUCLEAR PROGRAM
double numberofnukes;
double totalprice;
char country [10];
char place [20];
char typeofnuke [30];
nuke:
cerr << " WELCOME TO THE NUKES R' US\n";
cout << " ## ## ## ## ###### ## ######## ### ######## \n";
cout << " ### ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " #### ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ###### ## ## ######## \n";
cout << " ## #### ## ## ## ## ## ######### ## ## \n";
cout << " ## ### ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ####### ###### ######## ######## ## ## ## ## \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
cerr << "What type of nuke would you like:\n";
cerr << "A mega, ultra, super, or grande bomb?\n";
cin >> typeofnuke;
cerr << "You have chosen a "<< typeofnuke <<" bomb!\n";
cerr << "Enter the number of " << typeofnuke << " nukes you would like to purchase: ";
cin >> numberofnukes;
totalprice = (numberofnukes * 20) + (numberofnukes * 20) * .05;
cerr << "Your total will be $" << totalprice << " with shipping and handling.\n";
cerr << "Would you like to have your nuke launched directly to a country?\n";
cin >> country;
if (strcmp( country, "yes") == 0)
{
cout << "Ok, which country?\n";
cin >> place;
}
else
{
cout << "OK, your nukes will be FedExed to you. They should arrive within one buisness day. Thank you!\n";
goto restart;
}
cerr << "Your nuke has been sent to... " << place << "!!!\n";
cerr << "The nuke will hit " << place << " in 10 seconds...\n";
sleep(1);
cerr << "10\n";
sleep(1);
cerr << "9\n";
sleep(1);
cerr << "8\n";
sleep(1);
cerr << "7\n";
sleep(1);
cerr << "6\n";
sleep(1);
cerr << "5\n";
sleep(1);
cerr << "4\n";
sleep(1);
cerr << "3\n";
sleep(1);
cerr << "2\n";
sleep(1);
cerr << "1\n";
sleep(1);
cerr << "0\n";
sleep(1);
srand ( time(NULL) );
printf ("%d people dead \n", rand() % 9102785);
srand ( 1 );
cerr << "Have a nice armaggedon!\n";
goto restart;
}
{
//TRANSPORTATION
trans:
cout << " ######## ######## ### ## ## ###### #### ######## \n";
cout << " ## ## ## ## ## ### ## ## ## ## ## \n";
cout << " ## ## ## ## ## #### ## ## ## ## \n";
cout << " ## ######## ## ## ## ## ## ###### ## ## \n";
cout << " ## ## ## ######### ## #### ## ## ## \n";
cout << " ## ## ## ## ## ## ### ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ###### #### ## \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
int numvan = 0;
int numpeople = 0;
int numleftover = 0;
cout << "Each bus holds 50 people. \n";
cout << "Each van holds 5 people. \n";
cout << "Enter the number of people that need a ride: \n";
cin >> numpeople;
numleftover = numpeople % 50;
numvan =numleftover / 5;
cout << "The number of buses needed = " << numpeople / 50 << "\n";
cout << "The number of vans needed = " << numvan + 1 << "\n";
goto restart;
}
{
//SPEED TICKET
speed:
cout << " ######## #### ###### ## ## ######## ######## \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## \n";
cout << " ## ## ## ##### ###### ## \n";
cout << " ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ## #### ###### ## ## ######## ## \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
long int speedcar = 0;
const int FINE = 100;
long int totalfine = 0;
cout << "The speed limit is 60 mph, enter the speed of the car: \n";
cin >> speedcar;
totalfine = FINE + ((speedcar - 60) * 10);
cout << "The total fine is $" << totalfine << ".\n";
goto restart;
}
{
//SURVEYING
survey:
cout << " ## ## ######## ### ###### ## ## ######## ########\n";
cout << " ### ### ## ## ## ## ## ## ## ## ## ## \n";
cout << " #### #### ## ## ## ## ## ## ## ## ## \n";
cout << " ## ### ## ###### ## ## ###### ## ## ######## ###### \n";
cout << " ## ## ## ######### ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ######## ## ## ###### ####### ## ## ########\n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
double temperature = 0.0;
double measuredL = 0.0;
double correction = 0.0;
double newlength;
cout << "Input the current tempurature in Fahrenheit:\n";
cin >> temperature;
cout << "Input the length you measured in inches:\n";
cin >> measuredL;
correction = 0.0000116 * (temperature - 20.0) * measuredL;
newlength = measuredL + correction;
cout << "The correct measured length is " << newlength << ".\n";
goto restart;
}
{
//SALES TAX
sales:
cout << " ####### ### ## ######## ###### \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## \n";
cout << " ###### ######### ## ###### ###### \n";
cout << " ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ###### ## ## ######## ######## ###### \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
float priceitem = 0.0;
float salestax = 0.0;
float totalcost = 0.0;
cout << "What is the sales tax where you liv (ex: .07, .08 etc.):\n";
cin >> salestax;
cout << "What is the price of the item you would like to buy:\n";
cin >> priceitem;
totalcost = priceitem + (priceitem * salestax);
cout << "The total price of your item is " << totalcost << ".\n";
goto restart;
}
{
//BOX VOLUME
volbox:
cout << " ## ## ####### ## ## ## ## ## ######## \n";
cout << " ## ## ## ## ## ## ## ### ### ## \n";
cout << " ## ## ## ## ## ## ## #### #### ## \n";
cout << " ## ## ## ## ## ## ## ## ### ## ###### \n";
cout << " ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## \n";
cout << " ### ####### ######## ####### ## ## ######## \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
int sidea = 0;
int sideb = 0;
int sidec = 0;
int totalvol = 0;
char units [10];
cout << "What are you measuring in (inches, feet, yards, etc.)?\n";
cin >> units;
cout << "How many " << units << " is the first side?\n";
cin >> sidea;
cout << "How many " << units << " is the second side?\n";
cin >> sideb;
cout << "How many " << units << " is third side?\n";
cin >> sidec;
totalvol = sidea * sideb * sidec;
cout << "The volume of the box is " << totalvol << " " << units <<" cubed.\n";
goto restart;
}
{
//RESTAURANT
food:
cout << " ######## ### ###### ######## ######## ####### ####### ########\n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ###### ## ## ###### ## ###### ## ## ## ## ## ## \n";
cout << " ## ######### ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ###### ## ## ####### ####### ####### \n";
cout << " \n";
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
int hamburgers = 0;
int fries = 0;
int sodas = 0;
char typesodas [10];
int cookies = 0;
char typecookies [10];
int appleturnovers = 0;
int salads = 0;
double foodprice = 0;
cout << " MENU:\n";
cout << "Hamburger------------------ $2.00\n";
cout << "Soda----------------------- $1.00\n";
cout << "Cookie--------------------- $1.00\n";
cout << "Apple-turnover------------- $1.75\n";
cout << "Salad---------------------- $1.50\n";
cout << "How many hamburgers would you like?\n";
cin >> hamburgers;
cout << "How many fries would you like?\n";
cin >> fries;
cout << "How many sodas would you like?\n";
cin >> sodas;
cout << "What kind of soda?\n";
cin >> typesodas;
cout << "How many cookies would you like?\n";
cin >> cookies;
cout << "What type of cookie would you like?\n";
cin >> typecookies;
cout << "How many apple-turnovers would you like?\n";
cin >> appleturnovers;
cout << "How many salads would you like?\n";
cin >> salads;
cout << "You have ordered: " << hamburgers << " hamburgers, " << fries << " fries, " << sodas << " " << typesodas << "s, " << cookies << " " << typecookies << " cookies, " << appleturnovers << " appleturnovers, and " << salads << " salads.\n";
foodprice = (hamburgers * 2.00) + (fries * 1.00) + (sodas * 1.00) + (cookies * 1.00) + (appleturnovers * 1.75) + (salads * 1.50);
cout << "Your total will be $" << foodprice << ". Thank you!\n";
goto restart;
}
{
//Rock, Paper, Scissors
rps:
cout << " ######## ####### ###### ## ## \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## \n";
cout << " ######## ## ## ## ##### \n";
cout << " ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## \n";
cout << " ## ## ####### ###### ## ## \n";
cout << " \n";
cout << " ######## ### ######## ######## ######## \n";
cout << " ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## \n";
cout << " ######## ## ## ######## ###### ######## \n";
cout << " ## ######### ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ######## ## ## \n";
cout << " \n";
cout << " ###### ###### #### ###### ###### ####### ######## ###### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## \n";
cout << " ###### ## ## ###### ###### ## ## ######## ###### \n";
cout << " ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ###### ###### #### ###### ###### ####### ## ## ###### \n";
rpstart:
int choice;
int compguess;
const int ROCK = 1;
const int PAPER = 2;
const int SCISSORS = 3;
{
srand((unsigned)time(0));
for(int index=0; index<1; index++)
compguess = (rand()%3)+1;
}
cout << "Type 1 for Rock, 2 for Paper, or 3 for Scissors...\n";
cin >> choice;
switch (choice)
{
case ROCK:
if (compguess == ROCK)
cout << "You = Rock Computer = Rock\nIt's a tie!\n";
else if (compguess == PAPER)
cout << "You = Rock Computer = Paper\nComputer wins!\n";
else
cout << "You = Rock Computer = Scissors\nYou win!\n";
break;
case PAPER:
if (compguess == ROCK)
cout << "You = Paper Computer = Rock\nYou win!!\n";
else if (compguess == PAPER)
cout << "You = Paper Computer = Paper\nIt's a tie!\n";
else
cout << "You = Paper Computer = Scissors\nComputer wins!\n";
break;
case SCISSORS:
if (compguess == ROCK)
cout << "You = Scissors Computer = Rock\nComputer wins!\n";
else if (compguess == PAPER)
cout << "You = Scissors Computer = Paper\nYou win!\n";
else
cout << "You = Scissors Computer = Scissors\nIt's a tie!\n";
break;
default:
cout << "That's not a choice, please try again...\n";
goto rpstart;
}
goto restart;
}
{
progm:
cout << " ######## ######## ####### ###### ######## ### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ### ### \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## #### #### \n";
cout << " ######## ######## ## ## ## #### ######## ## ## ## ### ## \n";
cout << " ## ## ## ## ## ## ## ## ## ######### ## ## \n";
cout << " ## ## ## ## ## ## ## ## ## ## ## ## ## \n";
cout << " ## ## ## ####### ###### ## ## ## ## ## ## \n";
cout << " ## ## ### ## ## ### ###### ######## ######## \n";
cout << " ### ### ## ## ### ## ## ## ## ## ## ## ## \n";
cout << " #### #### ## ## #### ## ## ## ## ## ## ## \n";
cout << " ## ### ## ## ## ## ## ## ## ## ## #### ###### ######## \n";
cout << " ## ## ######### ## #### ######### ## ## ## ## ## \n";
cout << " ## ## ## ## ## ### ## ## ## ## ## ## ## \n";
cout << " ## ## ## ## ## ## ## ## ###### ######## ## ##\n";
int decision;
choicea:
cout << "TYPE IN THE NUMBER OF THE PROGRAM YOU WOULD LIKE TO OPEN...\n";
cout << "1 = FIREFOX 2 = ICHAT 3 = FLIGHTGEAR 4 = VLC 5 = ITUNES\n";
cin >> decision;
switch (decision)
{
case 1:
system("open /Applications/Firefox.app");
break;
case 2:
system("open /Applications/iChat.app");
break;
case 3:
system("open /Applications/Flightgear/Flightgear.app");
break;
case 4:
system("open /Applications/VLC.app");
break;
case 5:
system("open /Applications/iTunes.app");
break;
default:
{
cout << "SORRY, THAT IS NOT ONE OF THE OPTIONS...\nPLEASE CHOOSE A VALID CHOICE...\n";
goto choicea;
}
}
goto restart;
}
}
{
end:
cerr << "SYSTEM LOGGING OUT";
sleep(1);
cerr << ".";
sleep(1);
cerr << ".";
sleep(1);
cerr << ".\n";
sleep(1);
return 0;
}
}