CS 1401, Quiz 7 (based on Test 2), TR version

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

2. A student will order a textbook only if the shipping cost is $3.99 or smaller and the expected delivery time is 7 days or less. Write down a Java statement that uses the known values cost and deliveryTime to assign, to a boolean variable order, true or false depending on whether the student will order. Draw the truth table for "and", "or", and "not". Use these truth tables to find the truth value of your expression when a company offers to deliver in 2 days at the cost of $7.50.















































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) blue by using a command
img.set(x, y, JRaster.blue);
Use a for-loop to draw a blue diagonal line (corresponding to y = x).