1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

AP Computer Science Help

Discussion in 'Software Development' started by dcf-joe, Oct 8, 2008.

Thread Status:
Not open for further replies.
  1. dcf-joe

    dcf-joe It's My Birthday! Thread Starter

    Jul 30, 2007
    I need help answering these questions. My Computer Science teacher does not teach us anything, but he gives us these humongous packets and then tests us over the material. None of us in the class can understand anything except Java basics, and I mean basic stuff like System.out.println. Anyways here are the questions:
    1. Which are the most commonly used number types in Java?
    2. When does the cast (long) x yield a different result from the call Math.round(x)?
    3. How do you round the double value x to the nearest int value, assuming that you know that it is less than 2 * 10^9?
    4. What is the difference between the following two statements? final double CM_PER_INCH = 2.54; and public static final double CM_PER_INCH = 2.54;
    5. What is wrong with the following statement? double circumference = 3.14 * diameter;
    6. What is the meaning of the following statement? balance = balance + amount;
    7. What is the value of n after the following sequence of statements? n--; n++; n--;
    8. What is the value of 1729 / 100? Of 1729 % 100?
    9. Why doesn't the following statement compute the average of s1, s2, and s3? double average = s1 + s2 + s3 / 3; //Error
    10. What is the value of Math.sqrt(Math.pow(x,2) + Math.pow(y,2)) in mathematical notation?
    11. Why can't you call x.pow(y) to compute x^y?
    12. Is the call System.out.println(4) a static method call?
    13. Assuming the String variable s holds the value "Agent", what is the effect of the assignment s = s + s.length()?
    14. Assuming the String variable river holds the value "Mississipi", what is the value of river.substring(1,2)? Of river.substring(2, river.length() - 3)?
    15. Why can't input be read directly from System.in?
    16. Suppose "in" is a Scanner object that reads from System.in, and your program calls String name = in.next(); What is the value of name if the user enters John Q. Public?
  2. Chicon


    Jul 29, 2004
    Hi dcf-joe,

    As it won't help you if I give you the answers of your homework, I suggest you to launch your Java IDE and make some tests. It's the better way to learn. Also, you'll find the solutions of most theorical questions here.
  3. DoubleHelix

    DoubleHelix Banned

    Dec 9, 2004
    You don't honestly expect someone else to do your homework, do you? Aside from rendering your education completely useless, it's also a violation of your school's code of conduct and could get you expelled. If your professor isn't teaching you anything, go to the head of the department or the dean.
  4. bkatz540


    Oct 23, 2003
    I'm currently in AP Computer Science, but these questions seem very easy for me. If your teacher hasn't taught you that stuff, that sucks, because a lot of those are basics. :(

    But like other people have said, no one is going to do your homework for nothing. If you pay me some money maybe I'll help you out, though. :) (y)
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/757371

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice