Results 1 to 3 of 3
  1. #1
    modman15 is offline Member
    Join Date
    Jan 2010
    Rep Power

    Post AP Comp Sci questions??

    Hey, It would be a real help if someone could assist me with these questions. Thank you for the effort.

    1. Write an expression to round x to the nearest integer (x is a double).
    (I think i have to cast something as an int to cut of the decimal, but idk how to use the x is a doulbe)

    2.Write the code to generate a random integer between 1 and 25.?

    3.What is the output of the following code fragment if the input value is 'G'?
    I believe the input is GGG, but for some reason i think it's a trick question lol.

    3. char inputChar = console.readInt();
    if (inputChar == 'A')
    System.out.print( "AAA" );
    else if (inputChar == 'G')
    System.out.print( "GGG" );
    System.out.print( "***");

  2. #2
    Lil_Aziz1's Avatar
    Lil_Aziz1 is offline Senior Member
    Join Date
    Dec 2009
    United States
    Rep Power


    heyy i'm in the same class! whenever i get stuck on homework, i refer to the AP Computer Science textbook that is given in the beginning of the course.
    "Experience is what you get when you don't get what you want" (Dan Stanford)
    "Rise and rise again until lambs become lions" (Robin Hood)

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power


    This is not a 'we do your homework for free' forum; if you want to pay for it you can go to rentacoder; if not you have to give it a try yourself. If you're stuck we'll be glad to help you out for free.

    kind regards,


Similar Threads

  1. Replies: 3
    Last Post: 03-09-2009, 07:37 AM
  2. get IP from other comp in LAN
    By hungleon88 in forum Networking
    Replies: 2
    Last Post: 09-20-2008, 01:21 PM
  3. I have Questions -_-
    By ChazZeromus in forum New To Java
    Replies: 5
    Last Post: 09-13-2008, 08:08 PM
  4. Just a Few Questions
    By pringle in forum New To Java
    Replies: 21
    Last Post: 01-09-2008, 06:21 PM
  5. Replies: 4
    Last Post: 11-27-2007, 11:59 PM

Posting Permissions

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