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" );
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.
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.