//Student: Luis Echegaray #include #include #include #include #include #include #include #include #include #include #include #include #include void menu(); //void intro(); void one(); //void two(); void three(); //void four(); void subone(); void subtwo(); void subthree(); void error(); //***********************Variable Declarations******************************* float opernum,subtfrom,subt,subans, sortchoice; float counter1,cal2; float cal1; float end,temp,sum1,thing[10],multi1,numsort; int choicethree; int driver=VGA; int mode=VGAHI,x,y,a,r; int choice,total,answers[20],highscore[20], draw, draws; char quizchoice[20], menuchoice1[20]; char ansquiz[5][5],tfquiz[5][5]; int answer; char planet[10] [30], temp1[10]; //******************************Program************************************** void main() { clrscr(); //intro(); menu(); getch(); } /* void intro() { initgraph(&driver,&mode,"\\TC\\BGI"); setcolor(3); settextstyle(10,0,2); delay(1000); outtextxy(80,75,"WELCOME TO MY PROGRAM"); getch(); for (x=0;x<=800;x++) { setcolor(RED); circle(x,100,50); } setcolor(4); settextstyle(7,0,2); delay(1000); outtextxy(30,180,"THIS WILL BE THE MOST FUN YOU EVER HAD!!"); getch(); for (x=800;x>=0;x--) { setcolor(WHITE); circle(x,200,50); */ //**************************************************************************** void menu() { cout<<"Welcome to My Program Menu\n"; cout<<"Choose a number.... \n"; cout<<"(1) Quiz\n"; cout<<"(2) Collection of Graphics\n"; cout<<"(3) Calculate\n"; cout<<"(4) Pointless\n"; cout<<"(5) Quit\n"; cin>>choice; switch (choice) { case 1:{one();break;} //case 2:{two();break;} case 3:{three();break;} //case 4:{four();break;} } } //*************************************************************************** void one() { if (choice==1) { clrscr(); cout<<"Please answer all question with lower case letters or words please\n"; cout<<"Are you ready for the quiz(Y/N)?\n"; cin>>quizchoice; if (strcmp(quizchoice,"n")==0) { cout<<"NO MORE PROGRAM FOR j00..\n"; } if (strcmp(quizchoice,"y")==0) { clrscr(); cout<<"Ok then in.....\n5\n"; delay(500); cout<<"4\n"; delay(500); cout<<"3\n"; delay(500); cout<<"2\n"; delay(500); cout<<"1\n"; delay(500); clrscr(); cout<<"This is the multiple choice section of this quiz..\n"; cout<<"The question are of random subjects..\n"; cout<<"press any key to continue..\n"; getch(); clrscr(); total=0; cout<<"Who was the 16th president? "<>answers[1]; clrscr(); if (answers[1]==1) { total=1; } cout<<"What is the square root of 36? "<>answers[2]; clrscr(); if (answers[2]==2) { total=total+1; } cout<<"Which on of these is a New York burrow? "<>answers[3]; clrscr(); if (answers[3]==3) { total=total+1; } cout<<"Which of the following is a true color? "<>answers[4]; clrscr(); if (answers[4]==2) { total=total+1; } cout<<"Who wrote 'The Seer King' ? "<>answers[5]; clrscr(); if (answers[5]==3) { total=total+1; } clrscr(); cout<<"You have reached the end of the multiple choice section.\n"; cout<<"You have answered "<>ansquiz[1]; clrscr(); if (strcmp(ansquiz[1],"france")==0) { total=1; } cout<<"The bubonic plague was also known as the _____ death"<>ansquiz[2]; clrscr(); if (strcmp(ansquiz[2],"black")==0) { total=total+1; } cout<<"Another name for the 'Medieval' times is the ______ ages "<>ansquiz[3]; clrscr(); if (strcmp(ansquiz[3],"middle")==0) { total=total+1; } cout<<"When a country is run by a queen it is called a ________"<>ansquiz[4]; clrscr(); if (strcmp(ansquiz[4],"monarchy")==0) { total=total+1; } cout<<"The Great Schism is when Europe elected multiple _____ "<>ansquiz[5]; clrscr(); if (strcmp(ansquiz[5],"popes")==0) { total=total+1; } cout<<"You have reached the end of the fill in the blanks section\n"; cout<<"You have answer "<>tfquiz[1]; clrscr(); if (strcmp(tfquiz[1],"t")==0) { total=1; } cout<<"4*8(12/3)-5=4 "<>tfquiz[2]; clrscr(); if (strcmp(tfquiz[2],"f")==0) { total=total+1; } cout<<"A nonagon has 7 sides "<>tfquiz[3]; clrscr(); if (strcmp(tfquiz[3],"f")==0) { total=total+1; } cout<<"When the word product is used it means division"<>tfquiz[4]; clrscr(); if (strcmp(ansquiz[4],"f")==0) { total=total+1; } cout<<"The Great Schism is when Europe elected multiple _____ "<>ansquiz[5]; clrscr(); if (strcmp(ansquiz[5],"popes")==0) { total=total+1; } cout<<"You have reached the end of the fill in the blanks section\n"; cout<<"You have answer "<>menuchoice1; if (strcmp(menuchoice1,"y")==0) { clrscr(); menu(); } if (strcmp(menuchoice1,"n")==0) { cout<<"Goodbye then...\n"; delay(1000); cout<<"Press any key to shutdown this program....\n"; } } } } //*************************************************************************** /* void two() { if (choice==2) { cout<<"You have selected option #2!!\n"; cout<<"Press any key to continue...\n"; getch(); initgraph(&driver,&mode,"\\TC\\BGI"); for(a=0;a<=800;a++) { setcolor(GREEN); line(0,0,sin(a)*400,cos(a)*400); delay(400/(a+10)); setcolor(0); line(50,50,sin(a)*400,cos(a)*400); } setcolor(YELLOW); settextstyle(2,0,5); delay(1000); outtextxy(240,375,"What does this look like?"); outtextxy(245,400,"Use your imagination."); delay(1500); outtextxy(260,450,"Press any key to continue..\n"); getch(); closegraph(); initgraph(&driver,&mode,"\\TC\\BGI"); settextstyle(9,0,2); outtextxy(70,150,"Now For a Colorful Experience!"); settextstyle(8,0,3); setcolor(YELLOW); outtextxy(140,200,"WARNING: INTENSE COLORS"); setcolor(RED); outtextxy(140,240,"Dont Forget Colorful..."); delay(2000); setcolor(BLACK); settextstyle(9,0,2); outtextxy(70,150,"Now For a Colorful Experience!"); settextstyle(8,0,3); outtextxy(140,200,"WARNING: INTENSE COLORS"); outtextxy(140,240,"Dont Forget Colorful..."); delay(1500); for(a=600;a>=0;a--) { setcolor(RED); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(5); } for(a=0;a<=600;a++) { setcolor(BLUE); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=600;a>=0;a--) { setcolor(GREEN); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=0;a<=600;a++) { setcolor(YELLOW); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=600;a>=0;a--) { setcolor(LIGHTMAGENTA); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=0;a<=600;a++) { setcolor(CYAN); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=600;a>=0;a--) { setcolor(LIGHTGRAY); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=0;a<=600;a++) { setcolor(LIGHTBLUE); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=600;a>=0;a--) { setcolor(LIGHTCYAN); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=0;a<=600;a++) { setcolor(LIGHTRED); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=600;a>=0;a--) { setcolor(MAGENTA); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=0;a<=600;a++) { setcolor(WHITE); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } for(a=600;a>=0;a--) { setcolor(BLACK); line(320,0+a,320+a,480*sin(a)); line(320,0+a,320-a,480*sin(a)); delay(0); } setcolor(GREEN); settextstyle(6,0,7); outtextxy(100,100,"Pretty Colorful Eh?"); settextstyle(2,0,5); outtextxy(120,200,"Inspired by sample program Mr. O'Dowd distributed"); delay(2000); getch(); closegraph(); } } */ //*************************************************************************** void three() { clrscr(); cout<<"YOU have chosen option #3!!\n"; delay(1500); clrscr(); cout<<"Choose what you want to do (1-3)..\n"; cout<<"(1). Arithmetic\n"; cout<<"(2). Averages\n"; cout<<"(3). Sort.\n"; cin>>choicethree; switch (choicethree) { case 1:{subone();break;} case 2:{subtwo();break;} case 3:{subthree();break;} default: printf("YOU ARE NOT FOLLOWING DIRECTIONS!!!!"); } } void subone()//************************************************************* { clrscr(); cout<<"Choose what type of operation you want to do..\n"; cout<<"(1) Addition\n"; cout<<"(2) Subtraction\n"; cout<<"(3) Multiplication\n"; cout<<"(4) Division\n"; cin>>opernum; if (opernum==1) { clrscr(); cal1=0; sum1=0; multi1=0; clrscr(); cout<<"Enter how many numbers you want to add..\n"; cin>>cal1; clrscr(); for (y=1;y<=cal1;y++) { cout<<"Enter a number\n"; cin>>thing[x]; sum1=thing[x]+sum1; clrscr(); } cout<<"Addition\n"; cout<<"Answer:"<>subtfrom; cout<<"Enter number you want to subtract from "<>subt; subans=subtfrom-subt; delay(500); clrscr(); cout<<"Subtraction\n"; cout<>cal2; for (y=1;y<=cal2;y++) { cout<<"Enter a number...\n"; cin>>thing[x]; sum1=thing[x]+sum1; counter1=counter1+1; clrscr(); } cout<<"Average: "<>numsort; for(x=1;x<=numsort;x++) { clrscr(); cout<<"Enter a number to sort..\n"; cin>>thing[x]; clrscr(); } for (y=1;y<=numsort;y++) { for (x=y+1;x<=numsort;x++) { if (thing[y] > thing[x]) { temp = thing[y]; thing[y] = thing[x]; thing[x] = temp; } } } for (y=1; y<=numsort; y++) { cout<>draw; cout<<"Enter another number!!\n"; cin>>draws; cout<<"These numbers will determine the (x/y) of the drawing\n"; initgraph(&driver,&mode,"\\TC\\BGI"); for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws++,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws++,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws++,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws++,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws++,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw,draws++,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw,draws++,x); delay(10); } draw=1; draws=1; for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=40;x++) { setcolor(RED); circle(x+draw++,draws,x); delay(10); } for (x=1;x<=30;x++) { setcolor(GREEN); circle(x+draw++,draws,x); delay(10); } getch(); closegraph(); } */ //for(a=500;ra>=0;a--) //{ //line(0,450+a,700,450+a); //} void error() { clrscr(); cout<<"You are not following directions!!\n"; getch(); }