//File: EchoTwoIntegers.java import CSLib.*; public class EchoTwoIntegers { // EchoTwoIntegers: read two integers and print in reverse // Author: S. Kamin, April 13, 2001 void echo () { InputBox in; OutputBox out; int i; int j; i = 2; //Assigns the value 2 to the memory location labeled i j = i; //Assigns the value residing in memory location i to the memory location labeled j j = j + 1; //Adds 1 to the value residing in memory location j and stores the result in //memory location labeled j //lhs = rhs; The right hand side (rhs) is evaluated // The result is stored in the memory location referenced by left hand side (lhs) //2 = j; ILLEGAL ==> 2 cannot reference a memory location since identifiers must begin with // a letter, not a number in = new InputBox(); //construct an InputBox and call it "in" in.setPrompt("Enter an integer:"); i = in.readInt(); in.setPrompt("Enter another integer:"); j = in.readInt(); out = new OutputBox(); //Construct an OutputBox and call it out out.print("The integers you entered were "); out.print(j); out.print(" and "); out.print(i); out.println("."); } }