2. Based on Figure below: a) What is the output for the following segment of code in Figure 1? public class Test2 public static void main (String(] args) 4 0 5 double d = 45.19; int i = (int) d; 7...


2. Based on Figure below:<br>a) What is the output for the following segment of code in Figure 1?<br>public class Test2<br>public static void main (String(] args)<br>4 0<br>5<br>double d = 45.19;<br>int i = (int) d;<br>7<br>System.out.printin (d) ;<br>System.out.printin (i);<br>System.out.printf(

Extracted text: 2. Based on Figure below: a) What is the output for the following segment of code in Figure 1? public class Test2 public static void main (String(] args) 4 0 5 double d = 45.19; int i = (int) d; 7 System.out.printin (d) ; System.out.printin (i); System.out.printf("The value of d and i is t.3f and td" + 10 11 "respectively",d,i); 12 13 Figure 1 b) What does the Java code display when the keyboard input is 20 aretheinputs in Figure 2 below? 30 17 Scanner keyboard = new Scanner (System.in); 18 System.out.printin ("Enter a string. "); 19 int n = keyboard.nextInt (); int m = keyboard.nextInt (); String s = keyboard.next (): System.out.printin ("m is " + m) ; System.out.printin ("s is " + s); 20 21 22 23 Figure 2

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here