
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

PracticeTrace1: Trace the following program. Show in the OUTPUT WINDOW exactly what is printed. SHOW ALL YOUR WORK!! import javax.swing.*; public class PracticeTrace1 { public static void main (String[] args) { // a1 a2 a3 f4 f int a1 = 12; // ____ ____ ____ ____ ____ int a2; // ____ ____ ____ ____ ____ int a3; // ____ ____ ____ ____ ____ float f4; // ____ ____ ____ ____ ____ float f5; // ____ ____ ____ ____ ____ a2 = 2; // ____ ____ ____ ____ ____ a3 = a1 / 3; // ____ ____ ____ ____ ____ f4 = 2.5f; // ____ ____ ____ ____ ____ f5 = (f4 + (float) a1) * 3.0f; // ____ ____ ____ ____ ____ a1 = a3 % 5; // ____ ____ ____ ____ ____ f4 = f4 / 4.0f; // ____ ____ ____ ____ ____ String out = “”; out += a1 + " : " + a2 + " : " + a3 +”\n”; out+= f4 + " : " + f5 + “\n”; JOptionPane.showMessageDialog(null, out, “Test Trace”, JOptionPane.INFORMATION_MESSAGE); }//end main }//end PracticeTrace