Computer Science 1026A/B Study Guide - Final Guide: Car Rental, Mutator Method, Chroma Key

662 views40 pages
terubarenuka and 39895 others unlocked
COMPSCI 1026A/B Full Course Notes
26
COMPSCI 1026A/B Full Course Notes
Verified Note
26 documents

Document Summary

_______: _______, _______, _______, _______, _______, _______, _______, ________ No calculators, cell phones, or other electronic devices are permitted either: _______, ________ [1 mark] is, if they were accessed row-by-row above, provide code to have them accessed column-by-column, and if they were accessed column-by-column, provide code to have them accessed row-by-row instead. [5 marks: rewrite this code segment to access the pixels in this picture in the other order. [4 marks] int sum = 0; for (int i = 0; i <= intarray. length; i++) return sum/intarray. length; sum = sum + intarray[i]: rewrite the above method to avoid generating the exceptions identified and circled above. Line 5: choose values for the integer variables a, b, c and d and the boolean variable bb to make the following expression evaluate to true. [10 marks: based on this result, write a new instance method for the picture class called countnonwhitepixels that determines the number of pixels that are not white in a picture.