Trace - what = Keyboard.readDouble(); three = 4 * one + 5 *...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// FILE: Trace.java // PURPOSE: An exercise in tracing a program and understanding // assignment statements and expressions. import cs1.Keyboard; public class Trace { public static void main (String[] args) { int one, two, three; double what; System.out.print ("Enter two integers: "); one = Keyboard.readInt(); two = Keyboard.readInt(); System.out.print("Enter a floating point number: ");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: what = Keyboard.readDouble(); three = 4 * one + 5 * two; two = 2 * one; System.out.println ("one " + two + ":" + three); one = 46 / 5 * 2 + 19 % 4; three = one + two; what = (what + 2.5) / 2; System.out.println (what + " is what!"); System.out.println ("one " + one + "two" + two + "three " + three); } }...
View Full Document

Ask a homework question - tutors are online