COMP 202 Exam Solutions Fall 2018: Ascii, Infinite Loop

184 views11 pages
10 Oct 2018
Course
Professor
hwpark22 and 40159 others unlocked
COMP 202 Full Course Notes
100
COMP 202 Full Course Notes
Verified Note
100 documents

Document Summary

Due to integer division, 1/2 is 0, casting 0 to double is 0. 0. 13 % 9 = 13 - (13 / 9) * 9 = 13 - 1 * 9 = 4. The confusing function basically just swap its input arguments" value and return x, therefore the first line will be 20 and 10. The confusing function return value of x, so y will still have value 20. Since function argument is just a copy of passed-in value,, x in the main function will not change. Therefore the second line is 10 and 20. Because the return value of increment function does not assign to any variables, therefore the value of x is still 3. System. out. println(args[1]); will print out the first command argument, which is 10. 33333 result will be first assigned to 11111 because x = 4 > 0 and since y = 3 < 4 so result will be assigned with 33333.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents

Related Questions