Assessment 1: Looping and 1D arrays


Instructions

This assessment is designed to be completed in fifty minutes or less. Your code must work on any valid inputs to receive credit.

Complete the template below such that you will provide code to solve the following problem. When you are satisfied with your solution, you should upload your solution, you should upload it to Blackboard. Each assessment comes with test cases that you can run before submitting your assignment, so you know how you're doing on it.

Imagine the user enters an array of integers and a number. Return a new array where all instances of that number are removed.

To save time, we've created a result array for you that is 100 elements long, and filled with zeroes; you can simply place the kept items into this array, in order. The grading script will remove the extra zeroes at the end automatically (and you can take a look at the cleanResult method in the template if you're curious how it works).

Please do not use any Java code or libraries that we have not covered in class; this defeats the purpose of the assessment.

Code Template and Test cases

Download the code template.