|
-
July 14th, 2005, 03:32 PM
#1
My favorite teacher
Hi,
I had a cool experience... so I thought I'll post it here 
This year C++ has become a part of my computer syllabus at school... So we have a teacher who teaches it. I had some previous knowledge of C++ - though I'm not at all good at it currently.
None of my friends have any idea about this language. So when she started teaching I could feel that she was really missing a lot of basic stuffs... bah.. that was a bad time - her class is really boring also. She used to make a lot of mistakes... but I don't remeber most of them.. but I remember a serious one.. read on
So after a few months, it was exams - ie the first exam on C++.
I felt the paper was quite easy... but there was one question that appeared pretty normal or needed no thinking on my first look (plz, i'm a newbie)... But after a while of writing, I looked at the question again.. OOPS! I had made a serious mistake!
I rewrote the answer. So, after a few weeks, the papers were corrected and I was eager to see how much I got for that question because none of my friends wrote correctly (note that they are super newbies and pretty poor because of this teacher's training )
To my shock, I didn't get anything for that question... the teacher marked it completely wrong! and all my classmates who wrote it wrong got full marks for the question.
So, I went to the teacher and argued with her for sometime ( maan, I don't know what I said)... atlast she agreed with me - coz I said to her that I tried it on the computer and my answer was correct... So it ended up with me and all others getting full marks... LOL.. I wz the only person who got it correct and all of us got full marks... So u want to see what the question is ??
Question
Convert the follow to a switch statement
Code:
if(dir == 'E')
est++;
if(dir == 'W')
wst++;
if(dir== 'N')
nth++;
if(dir == 'S')
sth++;
else
unk++;
Answer which she thinks is correct and what all the others also wrote
Code:
switch(dir)
{
case 'E' : est++; break;
case 'W' : wst++; break;
case 'N': nth++; break;
case 'S': sth++; break;
default : unk++;
}
My Answer 
Code:
switch(dir)
{
case 'E' : est++; unk++; break;
case 'W' : wst++; unk++; break;
case 'N': nth++; unk++; break;
case 'S': sth++; break;
default : unk++;
}
It was she who gave one another question and a strange output... that made me go very confused and she won't explain why that output was happening... actually the question was this(I posted it here a few months ago the time she gave it)
One more year is left with her! I don't know how much I'm going to suffer. Did anyone have any experiences like this?
(sorry about making the title ironic)
-
July 15th, 2005, 01:07 AM
#2
Re: My favorite teacher
Oh come on,
I had a maths teacher in University that was much worse than that. Unfortunately there is not much you can do about it. (Once I got so angry that I had to go to the blackboard and give my own proof of a theorem since hers violated basic mathematical principles). But do not worry it will be over soon, be patient.
Extreme situations require extreme measures
-
July 15th, 2005, 02:40 AM
#3
Re: My favorite teacher
Teachers hated me. I hated them.
My maths teacher, was in the classroom twice in a whole year. Once to say "hello, I'll be your teacher", then to say "good luck with your final exams". -Well he might have been in class more than twice, but everytime I actually attended his class, he wasn't there.
I once gave more insight about an Afrikaans poem than my teacher - needless to say, that was my best subject (Language) and best marks..
-
July 15th, 2005, 03:42 AM
#4
Re: My favorite teacher
In my first two years in high school I had at physics a woman teacher that wasn't too good at it (to use an euphemism) (though she was good looking ). Usually when hard problems were to be solved, I was asked to do that at the table (I was the best at math and physics in my class, and many others ), and sometimes I used methods she didn't like or was unfamiliar with. So, in several ocasions, when she tried to convince me that her method was better, we started solving the problem in parallel at the table, each one using his own method. And usually I was winning... 
Anyway, it's fun to remember things from high school. 
And yes, I had some interestng "conflicts" in college too.
-
July 15th, 2005, 04:32 AM
#5
Re: My favorite teacher
I cannot complain I have a good maths teacher and a very good programming teacher.
-
July 15th, 2005, 06:29 AM
#6
Re: My favorite teacher
 Originally Posted by NoHero
I cannot complain I have a good maths teacher and a very good programming teacher. 
Lucky you. My maths teacher is quite good.. but this teacher is really stupid.
I remember one time I made her stuck - Hey, I don't know the answer to that question till now! (my main aim at that time was to make her stuck)
We used to learn BASIC before, and this same teacher taught that.
So, I showed her a program
10 INPUT A$, B$
20 PRINT A$
30 END
Now at runtime if i enter
Hi,how are you
Hi will be stored into A$ and how are you will be in B$
So I asked her.. what if the user wants
Hi, How are you in A$ and Fine, thankyou in B$ (NOTICE THE ',')
But when you enter this at runtime:
Hi, How are you,Fine,thankyou
it would ask me "Redo from start"
So I asked her what if the user wants it like how I wanted. She stood there for about 5-10 minutes thinking... atlast the period got over and she told me that it is impossible to do that. 
Btw, anybody knows how to get around this problem with BASIC (i don't really care abt BASIC now.. but it maybe useful knowing)
-
July 15th, 2005, 06:59 AM
#7
Re: My favorite teacher
Btw, anybody knows how to get around this problem with BASIC (i don't really care abt BASIC now.. but it maybe useful knowing)
I suggest posting this question in the VB forum.
-
July 15th, 2005, 07:03 AM
#8
Re: My favorite teacher
 Originally Posted by cilu
I suggest posting this question in the VB forum.
VB doesnot use any INPUT statements... so it maybe of no use
BASIC is outdated but they still teach it in my school for the kids(i hate the school also)
-
July 15th, 2005, 07:04 AM
#9
Re: My favorite teacher
I suggest posting this question in the VB forum.
Even they, may not be able to handle QBasic questions. Try to find people with old age and send them a pm.
Extreme situations require extreme measures
-
July 15th, 2005, 07:09 AM
#10
Re: My favorite teacher
 Originally Posted by panayotisk
Even they, may not be able to handle QBasic questions. Try to find people with old age and send them a pm. 
Hm.. let me see about that.. where do you think I can find them?
-
July 15th, 2005, 08:33 AM
#11
Re: My favorite teacher
We had few teachers candidate at our company interviews. No one was accepted.
-
July 15th, 2005, 08:35 AM
#12
Re: My favorite teacher
 Originally Posted by ovidiucucu
We had few teachers candidate at our company interviews. No one was accepted. 
Some our IT teacher's come out from business (VOEST) and heck they are good. But well... vice versa it does not work at all. Everything that is too intelligence for a teacher position goes into business... and sadly vice versa.
-
July 15th, 2005, 08:40 AM
#13
Re: My favorite teacher
 Originally Posted by NoHero
Some our IT teacher's come out from business (VOEST) and heck they are good. But well... vice versa it does not work at all. Everything that is too intelligence for a teacher position goes into business... and sadly vice versa.

Well, I forgot to say they were C/C++ teachers. Poor little students!!!
-
July 15th, 2005, 08:49 AM
#14
-
July 15th, 2005, 09:13 AM
#15
Re: My favorite teacher
 Originally Posted by bijuabrahamp
Btw, anybody knows how to get around this problem with BASIC (i don't really care abt BASIC now.. but it maybe useful knowing)
 Originally Posted by panayotisk
Try to find people with old age and send them a pm. 
Old age?? Hey, QBasic wasn't that long ago! Here's a QB program that takes a line of input and stores it all (including commas) in a single variable, then breaks that line at the second comma, if two commas are present. I think this is what bijuabrahamp was after. It's a bit long-winded perhaps, but it works.
Code:
' Get an entire line of input (without breaking at commas)
LINE INPUT a$
' Find the first comma (if one exists).
n = INSTR(a$, ",")
' If one comma exists, find the second one.
IF n > 0 THEN n = INSTR(n + 1, a$, ",")
IF n > 0 THEN
' If two commas were found, break the string in two using the second
' comma as the dividing line
b$ = MID$(a$, n + 1)
a$ = LEFT$(a$, n - 1)
PRINT "a$ = "; a$
PRINT "b$ = "; b$
ELSE
' Otherwise, print an error message
PRINT "Formatting error."
END IF
Or if you're using an even worse form of BASIC that requires line numbers and doesn't allow block-if statements (like GW-BASIC, which I was taught in high school in 1995):
Code:
10 LINE INPUT a$
20 n = INSTR(a$, ",")
30 IF n > 0 THEN n = INSTR(n + 1, a$, ",")
40 IF n > 0 THEN GOSUB 60 ELSE PRINT "Formatting error."
50 END
60 b$ = MID$(a$, n + 1)
70 a$ = LEFT$(a$, n - 1)
80 PRINT "a$ = "; a$
90 PRINT "b$ = "; b$
100 RETURN
Output from a sample run:
Code:
How are you, Smasher?,Fine, thanks!
a$ = How are you, Smasher?
b$ = Fine, thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|