Sale!

CSE 205 Assignment #9 solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (4 votes)

Program Description

Assignment #9 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 sumOfNumbersLargerThanFirst 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 sumOfNumbersLargerThanFirst(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
CSE 205: Object-Oriented Program & Data
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.

Test Cases

Download the following input files, input1.txt, input2.txt, input3.txt, and
input4.txt, and the following output files, output1.txt, output2.txt, output3.txt,
and output4, and save them in the same directory as Assignment9.java is
located.
input1.txt (https://canvas.asu.edu/courses/44324/files/14227809/download?
wrap=1) (https://canvas.asu.edu/courses/44324/files/14227809/download?
wrap=1)
input2.txt (https://canvas.asu.edu/courses/44324/files/14227810/download?
wrap=1) (https://canvas.asu.edu/courses/44324/files/14227810/download?
wrap=1)
input3.txt (https://canvas.asu.edu/courses/44324/files/14227811/download?
wrap=1) (https://canvas.asu.edu/courses/44324/files/14227811/download?
wrap=1)
input4.txt (https://canvas.asu.edu/courses/44324/files/14227812/download?
wrap=1) (https://canvas.asu.edu/courses/44324/files/14227812/download?
wrap=1)
output1.txt (https://canvas.asu.edu/courses/44324/files/14227815/download?
wrap=1) (https://canvas.asu.edu/courses/44324/files/14227815/download?
wrap=1)

output2.txt (https://canvas.asu.edu/courses/44324/files/14227818/download?
wrap=1) (https://canvas.asu.edu/courses/44324/files/14227818/download?
wrap=1)
output3.txt (https://canvas.asu.edu/courses/44324/files/14227819/download?
wrap=1) (https://canvas.asu.edu/courses/44324/files/14227819/download?
wrap=1)
output4.txt (https://canvas.asu.edu/courses/44324/files/14227820/download?
wrap=1) (https://canvas.asu.edu/courses/44324/files/14227820/download?
wrap=1)

Error Handling

Your program should be robust enough to handle all test cases above.
——————————————–

What to turn in:

-Submit your Assignment9.java file using Gradescope-> Assignment9 on
canvas.asu.edu. Make sure that your files are compiling and passing all test
cases. You can submit multiple times until the assignment deadline.

Grading Criteria:

____/ 5 Documentation (Each class file needs to have a header with your
name, your information, and program description, each method needs its
description and comments within your code)
____/ 1 Indentation and spacing (easy to read)
____/ 6 Required classes/methods and functionalities implemented
____/ 8 Produces correct results (test cases – auto graded)
Total points: 20
—————————

ASU disclaimer (http://www.asu.edu/asuweb/disclaimer/)
Copying any content of this page and posting on the Internet will be a
violation of the copy right.