Quiz1 - g //z = (5>y) ? z *2 : z/2; /...

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

View Full Document Right Arrow Icon
package week4; p import java.applet.Applet; import java.awt.*; i public class Quiz1 extends Applet { p public void paint(Graphics g){ int y = 10; int z = 20; i y+=2; g.drawString("Answer y+=2: " + y , 70, 100);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: g //z = (5>y) ? z *2 : z/2; / if(100>y){ z *= 2; } else{ z/=2; } g.drawString("Answer y: " + y , 70, 120); g.drawString("Answer z: " + z , 70, 140); } }...
View Full Document

Ask a homework question - tutors are online