//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Ben Balkwill @
//@ Semester Project Ver. 1.03d @
//@ Last Edited on 1/23/02 @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
const int WIDTH = 15;
const int WIDTH2 = 25;
const int WIDTH3 = 10;
const int WIDTH4 = 40;
#include
#include
#include
#include
//Function startagain
//Use: prompts and asks if you want to restart program.
void startagain(char &again);
//Function check
//Use: prompt for picture function to choose picture.
void check(char &choice);
//Function number
//Use: guess a number between 1-100, keeps looping if you continue to guess incorrectly.
void number(int randnum, int high, int low, int guess, int guesses);
//Function picture
//Use: outputs pictures made with characters you chose.
void picture(char choice, int x, int y, int count);
//Function allowances
//Use: Input your allowance and it outputs amounts per a certain amount of time.
void allowances(double allowance, double hourly, double yearly, double day,
double minute, double second, double monthly, double decade, double mil, double century);
//Function dice
//Use: Input amount of times to roll the dice, and output for each possible roll.
void dice(int num2, int num3, int num4, int num5, int num6, int num7, int num8, int num9,
int num10, int num11, int num12, int rollnum, int num, int die, int die2, int roll, int total);
int main ()
{
//Variable declaration.
char start, choice, again;
//start = main prompt for which part of program you are going to use.
//choice = which picture you choose.
//again = whether or not your restarting the program.
double hourly, yearly, day, minute, second, allowance, monthly, decade, mil, century;
//all variables used in allowance program as per timely income.
int x , y, randnum, high, low, guesses, guess, count;
//x and y are variables used for FOR statements in picture drawer.
//randnum is used for number guesser and is the number you want to guess.
//high and low are what your guesses are between (1-100 = low-high).
//guesses is how many guesses youve made.
//guess is what you guessed.
//count is used in picture drawer in the picture drawer.
guesses = 0; //default for guesses.
low = 1; //lowest guess you can make.
high = 100; //highest guess you can make.
time_t seconds; //used for randomizing numbers.
time(&seconds); //used for randomizing numbers.
srand((unsigned int) seconds); //used for randomizing numbers.
//Main starting point.
cout<<"Ben's Semester Project ver 1.03d"<>start;
if (start=='n'||start=='N') //Number Guesser runs only IF you choose 'n' or 'N'
{
guess = 0;
randnum = rand() % (high-low+1) + low; //randomizes number you have to guess.
cout<>again; //input for restart.
startagain(again); //chooses whether to start program over according to input.
}
else if (start=='d'||start=='D') //Dice Roller runs only IF you choose 'd' or 'D'
{
int num2, num3, num4, num5, num6, num7, num8, num9, num10,
num11, num12, rollnum, num, die, die2, roll;
int total;
//setting all variables to zero.
num2 = 0;
num3 = 0;
num4 = 0;
num5 = 0;
num6 = 0;
num7 = 0;
num8 = 0;
num9 = 0;
num10 = 0;
num11 = 0;
num12 = 0;
total = 0;
roll = 0;
die = 0;
rollnum = 0;
num = 0;
die2 = 0;
dice(num2, num3, num4, num5, num6, num7, num8, num9, num10, num11,
num12, rollnum, num, die, die2, roll, total); //runs function of dice roller.
cout<>again; //input for restart.
cout<>again; //input for restart.
cout<>again; //input for restart.
//chooses whether to start program over according to input.
startagain(again);
}
else //if user types in wrong character.
{
cout<<"ERROR!!! Restarting..."<>choice;
cout<>guess; //inputs guess.
if (guesshigh) //only if your guess is higher then possible.
{
cout<<"Error you hippy! try again..."<guess) //if guess is high but in parameters, highest possible
//parameter becomes your guess.
{
cout<<"Your guess is too low..."<=0; --x) //**** BOTTOM HALF ****
{
cout<>allowance; //inputs allowance.
cout<>rollnum; //inputs amount of times to roll.
if (rollnum<0)
{
cout<1000000)
{
cout<<"Number way too big!!! restarting program..."<