subject

In this problem, there will be the construction of a program that reads in a sequence of integers from standard input until 0 is read and store them in an array (including 0). This is done using iteration (choose one of for, while, or do-while loop). You may assume that there will not be more than 100 numbers.
Then compute the minimum number, count odd integers, compute the sum of numbers that are larger than the first number in the array, and compute the largest even integer in the sequence using recursion. Thus, you will create recursive methods findMin, countOddNumbers, computeLargestEven, and in Assignment9 class and they will be called by a main method.
Specifically, the following recursive methods must be implemented (These methods should not contain any loop):

public static int findMin(int[] numbers, int startIndex, int endIndex)
public static int countOddNumbers(int[] elements, int startIndex, int endIndex)
public static int computeLargestEven(int[] elements, int startIndex, int endIndex)
public static int (int[] elements, int startIndex, int endIndex, int firstNumber)

If these methods are implemented using a Loop or any Static Variable, points will be deducted even if your program passes test cases. DO NOT use any Static Variables.
The program should output the results of those calculations to standard output. Your program will continue to read in numbers until the number 0 is entered. At this point, the calculations will be outputted in the following format:

The minimum number is 0
The count of odd integers in the sequence is 0
The largest even integer in the sequence is 0
The sum of numbers larger than the first is 0
Note that the result values will be different depending on test cases (not always 0).

Do not output a prompt to query for the numbers. The number 0 is included in the sequence of numbers and should be included in all of your calculations.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:40
Reading characters and strings from the keyboard: consider the following c++ program 1. #include 2. #include 3. using namespace std; 4. mystring1 5. 6. int main() 7. { 8. 9. string mystring1, mystring2; mychar1 10. 11. 12. char mychar1, mychar2; 13. 14. cout< < "enter a string: "; mychar2 15. 16. cin> > mystring1; // 17. cin.get(mychar1); 18. cin> > mychar2; 19. getline(cin,mystring2); mystring2 20. 21. 22. cout<
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. andy received a potentially infected email that was advertising products. andy is at risk of which type of security threat? a. spoofing b. sniffing c. spamming d. phishing e. typo-squatting
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
1. which of the following is not an example of an objective question? a. multiple choice. b. essay. c. true/false. d. matching 2. why is it important to recognize the key word in the essay question? a. it will provide the answer to the essay. b. it will show you a friend's answer. c. it will provide you time to look for the answer. d. it will guide you on which kind of answer is required.
Answers: 1
You know the right answer?
In this problem, there will be the construction of a program that reads in a sequence of integers fr...
Questions
question
Biology, 28.02.2020 23:18
Questions on the website: 13722360