import uwcse.graphics.*; /** * Exercise 7.8 p 250 (a,b,c,d and g). Skip e and f. */ public class Exercise78 { /** * What is p implies q? * @return p implies q */ public boolean implies(boolean p, boolean q) { // p=>q has the following truth table (see p 244) // p:true q:true p=>q:true // p:false q:true p=>q:true // p:true q:false p=>q:false // p:false q:false p=>q:true } /** * Are the three integers a, b and c in order (i.e. a<b<c)? * @return a<b AND b<c */ public boolean inOrder(int a, int b, int c) { } /** * Does ARectangle r1 have a greater width than ARectangle r2? * @return r1 has a greater width than r2 */ public boolean isWider(Rectangle r1, Rectangle r2) { } /** * Is point (x1,y1) farther from the origin than point (x2,y2)? * @return point 1 is farther from the origin than point 2 */ public boolean fartherFromOrigin(int x1, int y1, int x2, int y2) { } /** * Are the three integers s1, s2 and s3 the lengths of the sides * of a right triangle? * @return s1,s2 and s3 are the lengths of the sides of a right triangle */ public boolean areSidesOfRightTriangle(int s1, int s2, int s3) { // If any is negative, they can't be the lengths of a triangle // Hypotenuse and sides of the supposedly right triangle int side1=s1; int side2=s2; int h=s3; // The hypotenuse is the largest of the 3 integers // Is it a right triangle? } }