Notices
Results 1 to 5 of 5

Thread: Care to help a n00b?

  1. #1 Care to help a n00b? 
    New Member
    Join Date
    Aug 2006
    Posts
    3
    I signed up for my school's computer science class, thinking it would be interesting, but after receiving the assignment, I was just... o.O??? I have no prior knowledge of computer science, so if anyone could take the time to explain these terms to me:

    here is a sample assignment to do [must be so simple for you guys, so please don't make fun of me too much!]. if someone can help me understand these terms, I think I can try cracking the rest myself.

    problem 1:
    Find the area of a trapezoid. Here, identify the input variables, their types, the assignment statement used, and the output produced.

    Variables:
    Input
    Output
    Assignment
    Questions needed to solve the problem
    Loops needed
    I suppose i should get a For Dummies guide soon. Thanks in advance for anyone who kindly assists.


    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Freshman
    Join Date
    Aug 2006
    Posts
    19
    Umm... did you learn anything yet, because no one can expect a person new to programming to do that. Anyway, what language are you using, if any?

    But that really doesn't matter, I'll just show you how the program would work.

    You would need four main variables: base, height, product and area.

    The program would simply multiply the base variable and the height variable and divide the product by 2 to result in the area variable.

    As to those questions, I already answered the variables. The input is the muliplication, and the output is the answer, I assume the assignment is to find the area of the trapezoid, the necessary questions are "What is the base?" and "What is the height?".

    As for the loops, well, you don't need any, at least, not the way I know.

    Oh, and by the way, you don't necessarily need four variables. Some languages don't like to do stuff like (2*8)/2.

    I hope that helps you and good luck with the class. If you need any additional help in making the program just tell me the language and I'll help you out.

    EDIT: oops, I was thinking about a triangle. The formula for finding the area of a trapezoid is the mean of the bases multiplied by the height.

    So instead of (x*y)/2 it's (base1+base2)/2 * Height. Sorry about that.


    Reply With Quote  
     

  4. #3 thanks! 
    New Member
    Join Date
    Aug 2006
    Posts
    3
    wow, that really helped.

    as for languages, i think we'll be covering java primarily [ap comp. sci.]
    Reply With Quote  
     

  5. #4  
    Forum Freshman
    Join Date
    Aug 2006
    Posts
    32
    AP comp science is usually C++. At least it was at my school. They had two levels of comp science.

    In C++ you would need the cin and cout fuctions (iostream.h). I haven't messed with C++ for a while. In any language you would need to have 2 inputs of the height and width in which then have the formula for a trapezoid performed on them. It should then have an output of the answer.
    Reply With Quote  
     

  6. #5  
    New Member
    Join Date
    Aug 2006
    Posts
    3
    well, it was. but now it's Java [checked the collegeboard site too]. thanks for the help, though
    Reply With Quote  
     

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