There are three problems in this homework.

Problem A

Write a method called addToZero that takes as input an array of integers, and returns true if there are two distinct integers in the array that add up to zero, and false otherwise. For example, when the input array is [12, 34, 56, -11, -34], addToZero should return true; when the input array is [23, 45, -34, 11], addToZero should return false. This program contains a dummy method called addToZero, and your solution should fill out the body of the method. After doing this, submit the .java file only into the dropbox in ICON called Homework1.

Problem B

Write a method called changeEvensToZeroes that takes as input an array A of integers, and changes every even integer in the array to a zero. For example, when input the array [12, 34, 17, 16, 23], changeEvensToZeroes should transform it to [0, 0, 17, 0, 23]. This program contains a dummy method called changeEvensToZeroes, and your solution should fill out the body of the method. After doing this, submit the .java file only into the dropbox in ICON called Homework1.

Problem C

Write a program that when run provides the user with two integers and asks him/her to input their sum; it reads the input that the user provides and prints feedback as to whether the input is actually the sum. This logic should run within the main method of this program .

To work on one of these problems using netBeans, you will have to open a new project on netBeans and then cut and paste the relevant stuff from the incomplete program I have written. I will explain this in class. I will also explain where you can find the .java file that you have to submit.

The homework is due 11.59 pm on Monday, September 9.