## CS 1401, Quiz 7 (based on Test 2), MW 12-1:20 version

Date: Wednesday, October 16, 2013
Name (please type legibly, ideally in block letters): ______________________________________________________________________

2. Tests make students nervous, their blood pressure goes up. The measurement of blood pressure consists of two numbers, the higher and the lower ones (e.g., 120/70). According to the American Heart Association, a blood pressure is considered normal if the higher pressure does not exceed 140 and the lower does not exceed 90. Write down a Java statement that uses the known values higher and lower to assign, to a boolean variable normal, true or false depending on whether the student has normal blood pressure or not. Draw the truth table for "and", "or", and "not". Use these truth tables to find the truth value of your expression when a student's blood pressure is 135/95.

```

```
6. Once you define a new raster img by using a command
```JRaster img = new JRaster();
```
you can make a point with coordinates (x,y) red by using a command
```img.set(x, y, JRaster.red);
```
Use a for-loop to draw a horizontal red line corresponding to y = 60.