There are few categories of mistakes/error/bug in programming. Suchs as logic erros, syntax errors, core dumpz (run time error)/
I came across many many types of mistakes in programming that student commit. These mitakes fall majorly into the syntax error which is the easiest to troubleshoot. As compared to logic errors, there are formal mathematical way to prove that the logic and the premise it holds.
As the old programming guru’s mantra: “It takes more pairs of eyes to spot the bug”
Below is NAF (Need A Fix) buggy code that I have created (50lines only....easy). Your "TASK" is to "SOLVE IT", "FIX IT", PLS DO NOT EAT IT!!!
PLS POST/SHARE your answers here, add in as comments.
//=======================================================
//=========================================================
NO KICK???????????!!!!!!!!!!!
try the below (100lines, 5qns), covers strings, STL containers, iterators. Errors such as syntax error, runtime error and a little bit of logic error.
Note: "HEROES ONLY"
//==========================================================
Sunday, October 17, 2010
Subscribe to:
Post Comments (Atom)
19 comments:
Cannot go pass the void errors. Any tips?
the code at which line?
for the 50-line. 1st void error already cannot pass.
erm... the error is at which line?
He's talking about line 6: "void whyCallMe(input){". "input"'s variable type is not declared.
cher, I am stuck for the common mistakes program...
int result = 0;
string strIn = "";
cout << "Spot the common mistake(s)" << endl;
result = func1(int 10,int 20);
cout << "sum 10+20: " << result << endl;
this part there is a syntax error and I cannot find it... can help me?
@ heng gnee: When you call a function, you don't declare the values that you pass to the function.
@heng gnee,
==>result = func1(int 10,int 20);
i already mentioned this example in class. just pass the number directly will do.
@HY, thanks for helping~~
http://snipt.net/hengnee/50-error-code
this is what I have managed so far...
http://snipt.net/sgxbuster/50-line-not-com
not done dunno how do le
@Johnathan Teo
Use your codeblock compiler to check the errors. You need to be able to recognize what kind of error it is when they show you. You need to know this during the lab tests, quizzes and exams.
@Johnathan, take a look at syntax error. usually they have a red wormly line below it. like you have a typo in m$ word.
then look at compiler output in the command window. it will give you some hints on the error.
http://snipt.net/hengnee/success-in-removing-mistakes
the getline part was the only part that I didn't get in the previous version of my post.
had to do damn lot of research to know that getline(cin, whatever) to input string and pass it through function... sorry for the very late work...
@heng gnee,
is better late then never.
anyway, the hints already released on the week discuss about I/O stuff
@heng gnee,
is better late then never.
anyway, the hints already released on the week discuss about I/O stuff
http://snipt.net/jellybanana/naf-50-lines
with a little help from henggnee, i have managed to finish this. Sorry bout the delay, I just started my engine haha.
http://snipt.net/jellybanana/naf-100-lines
Help me check if I've done it correctly, thank you.
@yiwei,
being later is better then never
Post a Comment