Homework1 - /* * Name: Amy Hoover * Assignment: Homework 1...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * Name: Amy Hoover * Assignment: Homework 1 * Class: COT 3100H * Date: 1/15/08 */ import java.util.*; i public class Homework1 { p byte op1 = 0; byte op2 = 0; byte op3 = 0; b //Homework object stores the three operators set by the user public Homework1() { op1 = 0; op2 = 0; op3 = 0; } //printTable gathers all the relevent TT info and prints the table public void printTable(){ //Prints the initial TT line and declares/initializes a,b,c,d System.out.println("a b c d answer"); byte a = -2, b = -2, c = -2, d = -2; //Cycles through all the possible combinations of a,b,c,d for (int i = 1; i <= 16; i++) { a = 0; else a = 1; i b = 0; else b = 1; c = 0; else c = 1; if((i%2) == 1) d = 0; else d = 1; //Prints the TT System.out.println(a+" "+b+" "+c+" "+d+" "+ this.getAnswer(a,b,c,d)); } }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
//Returns whether the answer is true or false with the given information public byte getAnswer(byte a, byte b, byte c, byte d)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Homework1 - /* * Name: Amy Hoover * Assignment: Homework 1...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online