Question: Write a Java program that takes two kinds of inputs: an array of 10 integers and another integer. If the array is sorted in ascending
Write a Java program that takes two kinds of inputs: an array of 10 integers and another integer. If the array is sorted in ascending order, then the output will be an array of 11 integers where all the integers (10 from the array and another integer) are sorted. If the array is not sorted, then the program will output a message saying “the array is not sorted”
Example 1
>>Enter the array of 10 integers: 3 4 7 12 19 21 22 27 29 42
>>Enter another integer: 18
>> The combined sorted array: 3 4 7 12 18 19 21 22 27 29 42
Example 2
>>Enter the array of 10 integers: 4 8 12 19 17 23 5 42 45 98
>>Enter another integer: 14
>> The inputted array is not sorted.
Step by Step Solution
3.37 Rating (156 Votes )
There are 3 Steps involved in it
Here is a Java program that takes an array of 10 integers and another integer and then checks whethe... View full answer
Get step-by-step solutions from verified subject matter experts
