4 questions need completed ASAP, in JAVA with error checking and comments.
Write a program that takes input of integers N and M (separated by space) on first line, followed by an array of N integers on second line (separated by space) and then M more lines, each with an integer. For each of the of those *M* integers, output "True" (without quotes), if that number is present in the array N. Output "False" (without quotes) otherwise.
Constraints:
0 < N < 20,000
0 < M < 15,000
Your output lines should not have any trailing or leading whitespaces
Input:
4 2
99 12 10 23
23
25
Output:
True
False
Explanation: An array of size 4 is taken, followed by 2 lines. 23 outputs True, since 23 is present in above array. 25 outputs False because it was not in the array of N numbers.
2.
Write a program that takes input of an integer N, followed by N more integers. The program should calculate the median of the set of N numbers. If N is even, median is N/2 th number.
Input#1:
5
1 8 22 13 4
Output#1:
8
Input#2:
4
9 1 10 11
Output#2:
9
3.
Write a program that takes input of an integer N, followed by N lines of input sentences. For each sentence, reverse each word in each sentence. The order of words are not reversed.
Note: Your output lines should not have any trailing or leading whitespaces.
0 < Max Number of Inputs <= 100
0 < Number of Words in one input < 100
0 < Length of Word In A Sentence < 20
Example:
Input:
3
RemoteIo is awesome
Candidates give interview
best candidates are selected
Output:
oIetomeR si emosewa
setadidnaC evig weivretni
tseb setadidnac era detceles
4.
You've built an in-flight entertainment system with on-demand movie streaming.
Users on longer flights like to start a second movie right when their first one ends, but they complain that the plane usually lands before they can see the ending. So you're building a feature for choosing two movies that will best fit the flight length.
Write a program that takes an input of an integer on the first line representing the flight length, followed by an array of integers on the second line (separated by space), each representing a different film's duration in minutes, and returns the best two movie durations that will fill the most of the flight time, or false if no movies match.
When building your function:
Assume your users will watch no more than two movies
Don't make your users watch the same movie twice
Optimize for runtime over memory
Input:
90
25 60 10 20 80
Output:
10 80
Explanation: of the movies available, the 3rd and 5th will be the best fit for the flight, in that they will fill the most of the duration.
Hi there!
I'm a professional Software Developer, and I'm ready to implement those programs. Price i updated because this is the reasonable price. Thanks
Best,
Maher