PDA

View Full Version : Computer Programming


hollygrove
Oct 12, 2011, 08:34 PM
Predict the output of the following code segments? [5 points each, total 10 pts]

1) System.out.print ("I am the incredible");
System.out.print ("computing\nmachine");
System.out.print ("\nand I will \namaze\n");
System.out.println ("you.");
System.out.println ("This line might/n be a trick");

2) int x = 23, why = 2, sum, diff, prod, quot, mod;
Sum = x y;
Diff = x - y;
Prod = x * y;
Quot = x / y;
Mod = x % y;
System.out.println (sum "\n" diff "\n" prod "\n" quot "\n" mod);

ScottGem
Oct 13, 2011, 03:41 AM
Thank you for asking our help with your homework assignment. However, there are some rules we have for doing so.
Do not simply retype or paste a question from your book or study material

We won't do your homework questions for you. You were given the assignment for you to learn.

If you come up with your own answer or process and post it for us to critique that is acceptable. If you have some SPECIFIC questions that you couldn't find or didn't understand, we may help with that.
But this is your assignment, so show us you have at least attempted to complete it on your own.

Thank you.