Question
1. use Java function, is_even(k), that takes an integer value and returns true if k is even, and false otherwise. However, your function cannot use
1. use Java function, is_even(k), that takes an integer value and returns true if k is even, and false otherwise. However, your function cannot use multiplication, modulo, or division operators.
2. use a Java function that takes a positive integer n and returns the sum of the squares of all the positive integers smaller than n.
3. use a Java function that receives an array of integers and determines if all the numbers in the array are different from each other (that is, they are distinct).
4. Write a short Java function that takes two arrays a and b of length n storing int values, and returns the dot product of a and b. That is, it returns an array c of length n such that c[i] = a[i] * b[i], for i = 0, ..., n-1.
5. use a Java function that counts the number of vowels in a given character string.
Short Project (25 points, submit a Java file of your program)
6. use a Java program that takes all the lines input to standard input and writes them to standard output in reverse order. That is, each line is output in the correct order, but the ordering of the lines is reversed. You can prompt the user to enter lines to be read. You can assume that the program should end when the user enters the String "DONE".
Step 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