Computer Science 252
Problem Solving with Java
Spring 2014, The College of Saint Rose
Agenda
Write a program Practice.java that draws a 20x20 filled square with its upper left corner at the mouse location each time the mouse is pressed. When the mouse is released, a frame of the square (still at the press point, not the release point) remains. (This is Exercise 2.7.4 in BDM).
Please submit only the file Practice.java in Submission Box under "InClass2" before you leave class.
Due at the start of class, Tuesday, January 21.
Please submit answers to these questions in Submission Box under "LA2" or in hard copy by the start of our next class. We will discuss these questions at the start of class, so no late submissions are accepted. Please be sure that your name is clearly indicated in all submissions.
int x = 7; int y = -3; int z = 1; double a = 7.5;
a.
x - z > y
b.
x/2 + y
c.
x/2.0 + y
d.
a/2 + z
e.
a + x * y + z
f.
!(x > z) && (a + x + y + 12 < 32) && (a * a * a / 4 == 12)
g.
true || (x * y * z / a < 11)
For this assignment, choose two topics in which you feel you need some practice and run through the "Tutor" for that topic. When you finish, you will be given a code that verifies your successful completion. Submit those codes for 15 points per tutorial completed.
If you find these useful and would like more practice, you can earn 10 bonus points for each additional tutorial you complete before the end of January.
Examples