CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 3 123 LastLast
Results 1 to 15 of 38
  1. #1
    Join Date
    May 2005
    Location
    Kuwait
    Posts
    65

    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)

  2. #2
    Join Date
    Apr 2003
    Location
    Athens, Greece
    Posts
    1,094

    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

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    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..

  4. #4
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    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.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  5. #5
    Join Date
    Mar 2004
    Location
    (Upper-) Austria
    Posts
    2,899

    Re: My favorite teacher

    I cannot complain I have a good maths teacher and a very good programming teacher.
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!

  6. #6
    Join Date
    May 2005
    Location
    Kuwait
    Posts
    65

    Re: My favorite teacher

    Quote 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)

  7. #7
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    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.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  8. #8
    Join Date
    May 2005
    Location
    Kuwait
    Posts
    65

    Re: My favorite teacher

    Quote 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)

  9. #9
    Join Date
    Apr 2003
    Location
    Athens, Greece
    Posts
    1,094

    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

  10. #10
    Join Date
    May 2005
    Location
    Kuwait
    Posts
    65

    Re: My favorite teacher

    Quote 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?

  11. #11
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: My favorite teacher

    We had few teachers candidate at our company interviews. No one was accepted.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  12. #12
    Join Date
    Mar 2004
    Location
    (Upper-) Austria
    Posts
    2,899

    Re: My favorite teacher

    Quote 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.

    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!

  13. #13
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: My favorite teacher

    Quote 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!!!
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  14. #14
    Join Date
    Mar 2004
    Location
    (Upper-) Austria
    Posts
    2,899

    Re: My favorite teacher

    Quote Originally Posted by ovidiucucu
    Well, I forgot to say they were C/C++ teachers. Poor little students!!!
    Poor little students... you speak of my heart... I thought of revoluting and take over the programming lessons in my class and reintroduce C++ as programming lanuage for the 12th Grade... Viva la revolution!

    /otherwise I will have C# and then I am really proselytized...
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!

  15. #15
    Join Date
    May 2005
    Location
    United States
    Posts
    526

    Re: My favorite teacher

    Quote 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)
    Quote 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!

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured