Results 1 to 3 of 3
Thread: AP Comp Sci questions??
- 01-17-2010, 03:29 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 1
- Rep Power
- 0
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" );
else
System.out.print( "***");
- 01-17-2010, 03:44 PM #2
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)
- 01-17-2010, 03:45 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,392
- Blog Entries
- 7
- Rep Power
- 17
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,
Jos
Similar Threads
-
How to add new row from JTable comp in netbeans GUI?
By zam in forum NetBeansReplies: 3Last Post: 03-09-2009, 07:37 AM -
get IP from other comp in LAN
By hungleon88 in forum NetworkingReplies: 2Last Post: 09-20-2008, 01:21 PM -
I have Questions -_-
By ChazZeromus in forum New To JavaReplies: 5Last Post: 09-13-2008, 08:08 PM -
Just a Few Questions
By pringle in forum New To JavaReplies: 21Last Post: 01-09-2008, 06:21 PM -
JAVA software solutions:For AP Comp. Science (Lewis,Loftus,Cocking)
By padutch in forum New To JavaReplies: 4Last Post: 11-27-2007, 11:59 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks