2. Based on Figure below: a) What is the output for the following segment of code in Figure 1? public class Test2 2 public static void main (String[] args) 4 D { 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>2<br>public static void main (String[] args)<br>4 D<br>{<br>double d = 45.19;<br>int i - (int) d;<br>7<br>System.out.println (d) :<br>System.out.printin (i);<br>10<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 2 public static void main (String[] args) 4 D { double d = 45.19; int i - (int) d; 7 System.out.println (d) : System.out.printin (i); 10 System.out.printf("The value of d and i is %.31 andd" + 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 Scanner keyboard = new Scanner (System.in); System.out.printin ("Enter a string."); 17 18 19 int n = keyboard.nextInt () ; int m = keyboard.nextInt (); String s = keyboard.next (); System.out.println ("m is 20 21 22 m); System.out.println ("s is " + s); 23 Figure 2

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here