Question: Hello, Please write source code in Java: Lab7C: Twinsies! For this last part of the lab, you will write a program that compares the contents

Hello,

Please write source code in Java:

Lab7C: Twinsies! For this last part of the lab, you will write a program that compares the contents of 2 single-dimensional arrays of the same size. Write a program that asks the user to enter the array size. The program will prompt the user to initialize each array with integer values. The program will compare the arrays by determining if the cells with the same index number have the same values. If all the cells with the same index number have the same values, the program will print out the statement The arrays are identical. If they are not the same, the program will print out the statement The arrays are not identical. The sample output is shown below. User input is in bold. Sample #1: Enter the size of the arrays: 4 Enter array 1 slot 0: 1 Enter array 2 slot 0: 1 Enter array 1 slot 1: 2 Enter array 2 slot 1: 2 Enter array 1 slot 2: 3 Enter array 2 slot 2: 3 Enter array 1 slot 3: 4 Enter array 2 slot 3: 4 The arrays are identical Sample #2: Enter the size of the arrays: 5 Enter array 1 slot 0: 78 Enter array 2 slot 0: 81 Enter array 1 slot 1: 81 Enter array 2 slot 1: 78 Enter array 1 slot 2: 6 Enter array 2 slot 2: 6 Enter array 1 slot 3: 97 Enter array 2 slot 3: 97 Enter array 1 slot 4: 14 Enter array 2 slot 4: 14 The arrays are not identical Sample run 3: Enter the size of the arrays: 2 Enter array 1 slot 0: 17 Enter array 2 slot 0: 17 Enter array 1 slot 1: 3 Enter array 2 slot 1: 3 The arrays are identical

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!