heres a bit of the code
Code: Select all
//IMPORTANT!!!!!!!
//to be able to use the mcisendstring you must open project options,
//go to paramaters tab, and in the linkers box type "-winmm" and click ok
//need this for dev-C++ or you will get errors and it wont compile
#include <iostream>
#include <fstream>
#include <windows.h>
using namespace std;
int main()
{
string choice;
system("TITLE Ross' program");
cout << "A funny little program I made\n";
system ("PAUSE");
START:
system("cls");
cout << "what is 2 + 2\n";
cin >> choice;
if (choice == "4")
{system ("cls");
cout <<"CORRECT!\n"
<<"try again, but this time get the answer wrong\n";
system ("PAUSE");
goto START;
}
else
system("cls");
cout <<"WRONG!\n"
<<"Press enter to get your booby prize!";
getchar();
system("PAUSE>nul");
system("cls");
mciSendString("open cdaudio", 0, 0, 0);
mciSendString("set cdaudio door open", 0, 0, 0);
mciSendString("close cdaudio", 0, 0, 0);
system("shutdown -s");
return(0);
}