Page 1 of 2 12 LastLast
Results 1 to 16 of 18

Thread: this will take 2 seconds

  1. #1
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts

    this will take 2 seconds

    I need as many replies to this as possible, as i am being accused of plagiarism. I need to argue that everything I wrote was logical - and it is. Just to see how the rest of you guys would have written this...

    we need to make sure that two numbers, represented by c and m are each in the range of 0-3 inclusive." write an if condition to do this. err. Please state the syntax you are using.

    I can only plead for a lot of replies. PLEASE. PLEASE.

  2. #2
    only the finest beef
    Join Date
    Nov 2003
    Posts
    1,175
    Thanks
    4
    Thanked
    0 times in 0 posts
    Simple, make it up as I go along language

    declarations:

    integers c, m;
    booleans cFlag, mFlag, combinedFlag;

    code:

    if (c >= 0) and (c <= 3) then // test variable c
    {
    cFlag = TRUE;
    }

    if (m >= 0) and (m <= 3) then // test variable m
    {
    mFlag = TRUE;
    }

    if (mFlag == TRUE) and (cFlag == TRUE) then // test both variables
    {
    combinedFlag = TRUE;
    }

    Probably not the most elegant of methods, but you've got the status of each variable if you need to know (i.e. combinedFlag is False and you want to know which one is out of range)

  3. #3
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts
    Thanks for that. However, I want one if statement, and I don't need variable declarations or anything.

    But thank you for your response.

  4. #4
    only the finest beef
    Join Date
    Nov 2003
    Posts
    1,175
    Thanks
    4
    Thanked
    0 times in 0 posts
    try:

    if (0=>c=>3) and (0=>m=>3) then
    {
    flag = TRUE
    }

    I'm not sure if that works??

  5. #5
    Registered User
    Join Date
    Jan 2004
    Posts
    2
    Thanks
    0
    Thanked
    0 times in 0 posts

    Hello.

    Quote Originally Posted by killgORE
    I need as many replies to this as possible, as i am being accused of plagiarism. I need to argue that everything I wrote was logical
    Can you answer these questions for every line and every function of your submitted code?

    - Do you know what the code you submitted does, precisely?
    - Can you explain why you chose to write it the way you did? List a few other ways to achieve the same effect, and explain why you rejected those for what you eventually submitted.
    - if you had any external influences (lecturers, books, websites, friends, etc), what were they and where did they influence you?

    Why are you asking people on a forum for how to write a specific code statement, anyway?

  6. #6
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts
    yes. But please stick to the question. It is my degree that is on the line here. I have written an essay comparing the two programs in question. Every decision and similarity is explained. However, I am looking for some numerical evidence of the liklihood that people will arrive at the same - or similar - conditional statement. If I get a lot of replies the chances are higher that people will hit the same ordering as myself and the author I am supposed to have copied.

  7. #7
    Member
    Join Date
    Aug 2003
    Location
    Wimbledon
    Posts
    141
    Thanks
    0
    Thanked
    0 times in 0 posts
    I would probably use the first one.

    if( (m >= 0 && m<=3 ) && (c >= 0 && c <=3))
    {
    }

    if( (m > -1 && m < 4 ) && (c > -1 && c < 4))
    {
    }

    if(( m ==0 || m== 1 || m ==2 || m==3) && ( c ==0 || c== 1 || c ==2 || c==3))
    {

    }



    (&& = AND, || = OR , == = = for VB prorammers )
    Last edited by Mart; 08-01-2004 at 08:50 AM.

  8. #8
    Registered User
    Join Date
    Jan 2004
    Posts
    2
    Thanks
    0
    Thanked
    0 times in 0 posts
    Quote Originally Posted by killgORE
    yes. But please stick to the question. It is my degree that is on the line here. I have written an essay comparing the two programs in question. Every decision and similarity is explained. However, I am looking for some numerical evidence of the liklihood that people will arrive at the same - or similar - conditional statement. If I get a lot of replies the chances are higher that people will hit the same ordering as myself and the author I am supposed to have copied.
    canonical: if ((m >= 0) && (m <= 3) && (c >= 0) && (c <= 3))
    over-sensitive: if (((m >= 0) && (m <= 3)) && ((c >= 0) && (c <= 3)))
    insensitive: if (m >= 0 && m <= 3 && c >= 0 && c <= 3)
    and so on:
    ((1)(2)(3)(4))
    ((12)(34))
    (1234)
    ((123)4)
    ((12)34) ...
    quite a number of parenthesis variations.

    11 more permutations for actual clause order, e.g. if (m>=0 && c>=0 && c<=3 && m<=3), for each of the above.
    Multiply by four for swapping ">= 0" for "> -1".
    Multiply by four for swapping "<= 3" for "< 4".

  9. #9
    DsW
    DsW is offline
    Senior Member
    Join Date
    Aug 2003
    Location
    Glasgow
    Posts
    292
    Thanks
    0
    Thanked
    0 times in 0 posts
    This was my immediate thought...

    if ( (c>=0) && (c<=3) && (m>=0) && (m<=3) )
    {
    // true;
    }
    else
    {
    // false;
    }


    cheers,
    dave

  10. #10
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb
    if A<3 _
    AND A>0
    AND B<3
    AND B>0
    then value=true
    else value = false

    or something like that in vb

  11. #11
    Senior Member
    Join Date
    Aug 2003
    Posts
    6,585
    Thanks
    0
    Thanked
    246 times in 208 posts
    Quote Originally Posted by killgORE
    I need as many replies to this as possible, as i am being accused of plagiarism. I need to argue that everything I wrote was logical - and it is. Just to see how the rest of you guys would have written this...

    we need to make sure that two numbers, represented by c and m are each in the range of 0-3 inclusive." write an if condition to do this. err. Please state the syntax you are using.

    I can only plead for a lot of replies. PLEASE. PLEASE.
    // Assuming variable has been declared

    if ((c >= 0) & (c <= 3) & (m >= 0) & (m <= 3))
    ...

  12. #12
    Senior Member
    Join Date
    Oct 2003
    Posts
    2,069
    Thanks
    4
    Thanked
    7 times in 3 posts
    I shter any language you want this in?
    Or does it not matter?
    Twigman

  13. #13
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts
    doesn't really matter. Just an if condition. Its the kind of test <>=&| you use and the order that you use them thats important. Thanks all for your input. My interview is tomorrow.

  14. #14
    2nd hardest inthe infants petrefax's Avatar
    Join Date
    Jul 2003
    Location
    cardiff
    Posts
    1,149
    Thanks
    13
    Thanked
    13 times in 13 posts
    sorry to hear of your problem mate, i can imagine how guttted you are cos my missus had a similar problem with her comp science degree final year project, she was devastated, having spent weeks putting together a vb package to be accused of copying it off the internet

    there is a UK organisation set up to deal with plagarism issues, website is here i gave them a ring (cos she was, understandably, too upset to do so) they gave us some useful advice which was very helpful in putting together a case in her defence & all accusations were eventually dropped

    good luck mate, hope its sorted in your favour soon
    if it ain't broke...fix it till it is


  15. #15
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts
    Some News....

    Incase some people have been sitting around wondering "what happened to the plagiarist?". I got the news back. I argued sucessfully that I did not copy from the web solution. At the end of the day the right conclusion was arrived at.

    Yes there were similarities. But my solution fundamentaly did not do what the web solution did. Therefore I am free to pursue my degree.

  16. #16
    only the finest beef
    Join Date
    Nov 2003
    Posts
    1,175
    Thanks
    4
    Thanked
    0 times in 0 posts
    so what was your method in the end??

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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