Compute the sum of odd numbers

Assignment Help JAVA Programming
Reference no: EM131599313

You are not allowed to use the Scanner class in this assignment and any assignment after this one. You will need to use InputStreamReader and BufferedReader (they are in java.io package) to process input and also take care of IOException.

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, compute the sum of odd numbers, count negative numbers, and compute the sum of numbers in the array are less than the last number entered right before 0. (You can assume that a user will enter at least one non-zero number before 0 is entered.) using recursion. Thus you will create recursive methodsfindMin, computeSumOfOdd, countNagative, and sumLessThanLast 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 computeSumOfOdd(int[] numbers, int startIndex, int endIndex)
public static int countNegative(int[] numbers, int startIndex, int endIndex)
public static int sumLessThanLast(int[] numbers, int startIndex, int endIndex, int lastNumber)
If these methods are implemented using a Loop or any Static Variable, points will be deducted (from the test cases) 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 sum of odd numbers is 0
The count of negative numbers is 0
The sum of numbers that are less than the last 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.

 

Reference no: EM131599313

Questions Cloud

What social work values are embraced : How do theoretical concepts translate into or guide specific practice goals and practice skills?What social work values are embraced?
Explain about imaginative approach to research conversation : Write about a three-page explanation of how two different sources look at your topic differently (you may make it longer, if you wish).
Experimental value for the change in oxidation : If I found an experimental value for the change in oxidation state for ClO3- to be 5, what would the balanced oxidation half reaction, balanced reduction.
Explain the key steps that might require a contingency plan : Explain the key steps that might require a contingency plan. Analyze how creativity and critical thinking relate to contingency planning.
Compute the sum of odd numbers : Compute the minimum number, compute the sum of odd numbers, count negative numbers, and compute the sum of numbers in the array are less than the last number
Discuss the critical thinking skills in the given process : The paper will not be just a report presenting information, but will be a paper that carefully examines and presents your own historical interpretation.
What measures did you use to track success of your project : What measures did you use to track the success of your project? In what way do you feel that your project has contributed to your company?
How would this research be valuable : How would this research be valuable? What possible benefits would there be for juvenile justice?
Create an array for gross_pay : Following are three arrays, each containing 20 data. Array emp_hours contain the number of hours worked by 20 employees

Reviews

Write a Review

JAVA Programming Questions & Answers

  Examine the clocktype class definition

Examine the ClockType class definition. How many attributes does it contain? Assume we have two classes and have instantiated an object from each class. How many copies of each class's attributes and methods exist in the instantiated objects?

  Describe the project requirements and other assumptions

Summarize the project requirements and other assumptions (i.e., budget, human resources, workload, environmental dependencies, etc.). Define a work breakdown structure and describe the methodology behind constructing one

  User to input a decimal number and ouputs the number

Write a program that prompts the user to input a decimal number and ouputs the number rounded to the nearest integer.Remember the rules around proper development style and form, including adding comments. A software developer should always add commen..

  Create an android application for pre-ordering beverages

Process Documentation for the Implementation La Cafe Android Application Summary of Project - create an android application for pre-ordering beverages and breakfast

  Program buttons that implements a window with three button

Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter

  Write a comparator class that compares products by price

Write a comparator class that compares Products by price. Declare a priority queue that uses the comparator class in number 3 to compare Products.

  Prepare a simple windows calculator in java it must have a

create a simple windows calculator in java. it should have a labeled text field for the user to provide input as well

  Create a java program to calculate

Create a Java Program to calculate the all grades inputted by a student, the average grade for the student, the letter grade for the student, and the valid inputted scores displayed in ascending order.

  Java implementations of bubble sort

The first project involves benchmarking the behavior of Java implementations of bubble sort, itinvolves writing the code to perform the benchmarking of the bubble sort algorithm.

  Create a personal lending library tool

Create a personal lending library tool - The user wants to keep track of their movies and games - which ones they own, whether or not they are currently loaned

  Example of a problematic programming situation or scenario

Suggest one (1) example of a problematic programming situation or scenario that the use or implementation of a sequence structure could resolve

  Program that allows user to search internet account number

Read, validate and store account number and internet usage for N customers - Calculate, store and display the cost for all customers and Calculate, store and display the cost for all customers

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd