Given a program called Identical.java, I need to complete the two missing lines (34 and 38), and replace the "?". The program includes two int arrays, and the output is True if the two arrays are identical and False if they are not.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Given a program called Identical.java, I need to complete the two missing lines (34 and 38), and replace the "?". The program includes two int arrays, and the output is True if the two arrays are identical and False if they are not.
1 import java.util.Scanner;
2
3 public class Identical {
4
public static void main (String[] args) {
6.
Scanner kb = new Scanner(System.in);
8
int] array_1, array_2;
9.
10
System.out.print("Size of array: ");
11
int size = kb.nextInt();
12
13
array_1 = new int[size];
14
array_2 = new int[size];
15
16
//Reading elements of array_1
17
System.out.print("Array 1: ");
18
for (int i=0; i<size; i++) {
19
array_1[i] = kb.nextInt();
20
System.out.print(array_1[i] + " ");
21
}
22
System.out.println();
23
24
//Reading elements of array_2
25
System.out.print("Array 2: ");
26
for (int i=0; i<size; i++) {
27
array_2[i] = kb.nextInt();
28
System.out.print(array_2[i] + " ");
29
}
30
System.out.println();
31
32
int count = 0;
33
for (int i=0; i<size; i++) {
34
if (?) {
35
count++;
36
}
37
}
38
if (?) {
39
System.out.println("True");
40
}
41
else {
42
System.out.println("False");
43
}
44
45
}
46 }
16 1
Transcribed Image Text:1 import java.util.Scanner; 2 3 public class Identical { 4 public static void main (String[] args) { 6. Scanner kb = new Scanner(System.in); 8 int] array_1, array_2; 9. 10 System.out.print("Size of array: "); 11 int size = kb.nextInt(); 12 13 array_1 = new int[size]; 14 array_2 = new int[size]; 15 16 //Reading elements of array_1 17 System.out.print("Array 1: "); 18 for (int i=0; i<size; i++) { 19 array_1[i] = kb.nextInt(); 20 System.out.print(array_1[i] + " "); 21 } 22 System.out.println(); 23 24 //Reading elements of array_2 25 System.out.print("Array 2: "); 26 for (int i=0; i<size; i++) { 27 array_2[i] = kb.nextInt(); 28 System.out.print(array_2[i] + " "); 29 } 30 System.out.println(); 31 32 int count = 0; 33 for (int i=0; i<size; i++) { 34 if (?) { 35 count++; 36 } 37 } 38 if (?) { 39 System.out.println("True"); 40 } 41 else { 42 System.out.println("False"); 43 } 44 45 } 46 } 16 1
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education