Thread: Little Help Here

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    3

    Question Little Help Here

    Can anyone help me with 3 questions I have for homework, please? I did the rest but I'm having a hard time differentiating between the 3 questions. They all seem like they're asking the same thing!! The class is Computer Programming using Algorithms and Logic. Thanks, in advance

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Can anyone help me with 3 questions I have for homework, please?
    Probably, but read our homework policy.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    3
    eh, I'm not asking you to answer the questions....I just need help in understanding what the questions are asking.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    At the very least you have to post the questions and state why you think they are asking.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    3
    Consider the following selection statement where X is an integer test score between 0 and 100.

    input X

    if (0 <= X and X < 49)
    output "you fail"

    else if (50 <= X and X < 70)
    output "your grade is" X
    output "you did OK"

    else if (70 <= X and X < 85)
    output "your grade is" X
    output "you did well"

    else if (85 <= X and X < 100)
    output "your grade is" X
    output "you did great"

    endif
    output "how did you do?"




    The 3 questions are:

    Give a set of values that will test the normal operation of this program segment.
    Defend your choices.


    Give a set of test values that will cause each of the branches to be executed.

    Give a set of test values that test the abnormal operation of this program segment.

    The first two seem to be askin g for the same thing, right? That would be a random #, say 40 that 0<=40<=49

    not understanding what abnormal operation is. Is that like entering an invalid character and not a number? Is that what its askin for?

    Am I at least close?

    Thanks for your help!

    Is that you in your avatar, by the way?

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    The first two seem to be askin g for the same thing, right? That would be a random #, say 40 that 0<=40<=49
    They are not exactly the same (just testing "normal operation" is less comprehensive), but it seems to me that you could reuse the test values.

    You might also have learnt that bugs tend to occur at boundaries, so you should select your test values wisely.

    not understanding what abnormal operation is. Is that like entering an invalid character and not a number? Is that what its askin for?
    That sounds correct.

    Is that you in your avatar, by the way?
    No.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed