the next program works fine in school where I work on an old DOS version of c++ but here at home it doesnt work and it doesnt know the sound commands .
my c++ version is 3.1
/* oeffor24.CPP Bepaal random 10 oefening op de tafels van vermenigvuldiging en geef een beoordeling . */ #include #include #include #include #include #include
void main() { clrscr(); int a,b ,aantal, uitkomst,punten=0;
randomize();
cout << "\nrekenprograma voor beginners " ;
for (aantal=1 ; aantal <= 10 ; aantal=aantal+1) { a=random(10)+1 ; b=random(10)+1 ; gotoxy(3,aantal); cout << setw(3)<< "\n\n\n\n" << a << "*"<< b << " = " ; cin >> uitkomst ;
if ( uitkomst == a*b ) { gotoxy(15,aantal); textcolor(2); cprintf ("\n\n\n\njuist"); sound(2000); delay(100); nosound(); punten=punten+1 ; } else { gotoxy(15,aantal); textcolor(4); cprintf ("\n\n\n\nfout") ; sound(500); delay(100); nosound();
} } cout << "\n U hebt "<< punten << "/10 gescoort" ; if (punten ==10) { sound(200) ; delay(100) ; sound(400) ; delay(200) ; sound(800) ; delay(400) ; sound(1600); delay(800) ; nosound() ; }
getch(); }
|