Feb 9, 2008 at 2:45pm UTC
this is a program like a questionar and it's imposible to find errors
//programi kuizi dituris
#include<iostream>
#include<cstdlib>
#include<time.h>
#include<windows.h>
int sakt();
void pasakt();
using namespace std;
void setcolor(unsigned short color)
{
HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hcon,color);
}
int sakt()
{
int i;
cout<<"Pergjigje e sakte\n points:";
i=i+5;
setcolor(5);
system("pause");
return i;}
void pasakt()
{cout<<"Pergjigje e pasakte\n LOJA MBAROJ";
system("pause");
return ;}
int main()
{int a,b;
setcolor (12);
cout <<"\n KUIZI PER DITURI\n";
Fillim:
srand(time(NULL));
a= 1 + rand() % (4 - 1 + 1);
switch (a)
{
case 1:{setcolor(11);
cout<<"1.Me cilen komand mbushet pjesa e zbrazer me nje karakter e cila eshte rezervuar per shtypje \nA. cout fill('s')\nB. cout.width(s)\n C.cout.precision(s)\n";
setcolor(10);
cin >>b;
if(b=='a')
{sakt();
goto Fillim;}
else if(b=='b')
pasakt();
else
pasakt();};
break;
case 2:{setcolor(11);
cout<<"2.Cila eshte komanda paraprocesorike ku shfrytezohen komandat e shtypjes dhe leximit(cout,cin)\nA. include<iostream>\nB. include<cstdlib>\nC. include<iomanip>\n";
setcolor(10);
cin>>b;
if(b=='a')
pasakt();
else if(b=='b')
{sakt();
goto Fillim;}
else
{ pasakt();}
}; break;
case 3:{setcolor(11);
cout<<"3.Cilat jane operatoret recional:\nA. <,<=,==,>,>=,!=.\nB. +,-,*,/.\nC. &&,||,!.\n";
setcolor(10);
cin>>b;
if(b=='a')
{
sakt();
goto Fillim;
}
else if(b=='b')
{pasakt();}
else
{pasakt();}
}
system ("PAUSE");
return 0;
}
Feb 11, 2008 at 10:10pm UTC
Could you use the insert code button? It makes code much easier to read, and people like me can't quickly understand a program this long, especially with nefarious goto commands.