Question: Need help creating code/ editing for this assignment if you look at the picture and within the code will have tasks and will show what
Need help creating code/ editing for this assignment if you look at the picture and within the code will have tasks and will show what to do. Here is the code that I created.
//lab5b ,name, cssc
import java.util.*; import java.lang.*; import java.io.*;
public class SetComparison {
public static void main(String[] args) { double[] arr1 =new double[10]; double[] arr2 =new double[10]; int a,b; Scanner con = new Scanner(System.in); System.out.println("Enter the size of Array 1"); do{ a = con.nextInt(); }while(con.hasNextInt()); System.out.println("Enter the size of Array 2"); do{ b = con.nextInt(); }while(con.hasNextInt()); if (a == b) { System.out.println("Enter the values of Array 1"); for (int i=0;i0.001)) System.out.println("the values are not same "); else System.out.println("the values are same "); } }
else System.out.println("The Array sizes are not same "); } }


1. Compare output 45.24 54.67 2.55 44. 61 65.29 49.75 Input 6 45.24 54.67 42.55 44.61 65.29 49 75 Enter the size of Array 1 Enter the size of Array 2 Exception in thread "main java .util. InputMismatchExcep at java .util Scanner. throw For (Scanner java: 909) Your output at java util. Scanner next (Scanner java: 1530) at java util. Scanner next Int (Scanner. java: 2160) at java. util. Scanner. next. Int (Scanner .java: 2119) at SetComparison .main (SetComparison.java :26) set one and set two are equal Expected output 2. Compare output 45.24 54.67 42.55 44. 61 65.29 49 75 Input 6 45.24 54.67 41.99 44. 61 65.29 49.75 Enter the size of Array Enter the size of Array 2 Exception in thread "main" java util. InputMismatchExcep att java util. Scanner throw For (Scanner java: 909) Your output at java .util. Scanner next (Scanner. java: 1530) at java. util Scanner nextInt (Scanner java :2160) at java util. Scanner. next. Int (Scanner.java 2119) at SetComparison main (SetComparison.java: 26 Expected output set one and set two are not equal 3. Compare output 45.24 54.67 42.55 Input 5 45.24 54.67 42.55 44. 61 65.29 49.75 Enter the size of Array 1 Enter the size of Array 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
