Question
Please write code simply (if else,for, while, do-while and array) according to the following information !!! Write a Java program that outputs the difference between
Please write code simply (if else,for, while, do-while and array) according to the following information !!!
Write a Java program that outputs the difference between two lists of integers. When entering a list, the user first enters the number of elements in the list. Then, she inputs the integers in that list. After entering two list of integers, the program must output the integers that belong to the first but not the second list. The order of the integers in the difference output must be consistent with the order of the integers in the first list (for instance, the difference in the first sample run is {2, 12, 4} not {12, 4, 2} nor {2, 4, 12}). Please see the below sample runs and be consistent with the output format.
Sample Runs. Enter the number of integers in the first list: Enter the integers in the first list: Enter the number of integers in the second list: Enter the integers in the second list: 11 34 The difference is 2 12 4 Enter the number of integers in the first list: Enter the integers in the first list: 21 Enter the number of integers in the second list: Enter the integers in the second list: 21 33 The difference is fStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started