2024-05-04, 10:57 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
Pages: [1]
  Print  
Author Topic: whats wrong with my program (it doesnt work)  (Read 4479 times)
0 Members and 1 Guest are viewing this topic.
games keeper
 

Elite
*
Posts: 1375

« on: 2004-01-06, 17:22 »

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();
}

Logged
Phoenix
Bird of Fire
 

Team Member
Elite (7.5k+)
*********
Posts: 8805

WWW
« Reply #1 on: 2004-01-07, 01:43 »

I'd wager that the libraries between your C++ compilers might be different.  Have you checked the make sure all the included header files are the same on each system?
Logged


I fly into the night, on wings of fire burning bright...
games keeper
 

Elite
*
Posts: 1375

« Reply #2 on: 2004-01-07, 12:34 »

thank you pho for solving my problem .

bah , now I have to downloa thecomplete school his librarys .
Logged
[WaRdeN]
 
Team Member
Archvile
*******
Posts: 134

« Reply #3 on: 2004-01-07, 14:46 »

ffs that's what I told you in IRC GamesKeeper
Logged
games keeper
 

Elite
*
Posts: 1375

« Reply #4 on: 2004-01-07, 14:49 »

then thank you 2 warden .
« Last Edit: 2004-01-07, 14:50 by games keeper » Logged
Pages: [1]
  Print  
 
Jump to: