Computer Science 252
Problem Solving with Java
Spring 2016, The College of Saint Rose
Agenda
Modify the Drag10Shirts example so that each TShirt object created has somewhere between 2 and 6 "stains" placed randomly on it. Note that both the number of stains and the positions of the stains should be chosen randomly. Each stain is a single graphics primitive (e.g., a FilledOval), and those stains are stored in an ArrayList within that TShirt, so that the stains move with the TShirt. You can earn full credit if all stains are the same size, color, and shape, but can earn up to 5 points of extra credit for more "interesting" stains.
Please demonstrate your program or submit only the file TShirt.java by email before you leave class. Email submissions should use a meaningful subject line, clearly indicating the course number and assignment name.
Modify the MovingFlags example to use enhanced for loops (i.e., the "for each" loops) wherever possible.
Please demonstrate your program or submit the Java files you modify by email before you leave class. Email submissions should use a meaningful subject line, clearly indicating the course number and assignment name.
Due at the start of class, Tuesday, April 12.
Please submit answers to these questions either as a hard copy (typeset or handwritten are OK) or by email to terescoj AT strose.edu by the start of class. Please use a clear subject line when submitting by email (e.g., CSC 252 Lecture 20 Assignment, Mary Smith). We will discuss these questions at the start of class, so no late submissions are accepted.
Write a method that takes an ArrayList of Double values as its parameter and returns the largest value found in the ArrayList. (5 points)
Terminology
Examples