15-110 Sections G-J / Spring 2010 / Quiz 4
Part
1)
[20pts] Written Quiz in Class (8 minutes)
Write isPeculiar and nthPeculiar.
(Students were provided with a brief description
of "peculiar" numbers (an
invented term) -- that is, positive integers that have only odd factors (that
is, they have no even factors).)
Part 2) [80pts] Programming Quiz in Recitation (25 minutes)
Students should log in, and have full access to the course notes, but nothing else (not the online API, nothing from resources, only links off of the "schedule" page).
Students should download DrawImages.java and EditImages.java, and also download sampleImage.jpg.
Students will have 25 minutes to write 2
programs:
Write a program, Program1.java, that
reads in the image in sampleImage.jpg and pixel-by-pixel creates the
mirror image, which it then writes to mirrorImage.jpg. The mirror image
has the left and right flipped, as in a mirror.
Say we have 30% A's, 40% B's, 20% C's,
and 10% D's in our class. Write a program, Program2.java, that displays
this information in a pie chart that is centered and fills half the
window. Be sure to use different colors and label each arc.
Students should email their code, as two attachments, to their CA at the end of the quiz.