Assessment 4: Nested Loops and 2D 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.

Write code that takes a list of integers from the user. Count the number of unique pairs of numbers that sum to 10 in the incoming list. We will guarantee that the incoming list is all unique integers. A number may be used more than once to form a sum, and each ordering of pairs is counted as a sum (so if the numbers 1 and 9 appear in the list, (1,9) and (9,1) are both pairs and therefore generate two pairs that add in towards the total sum of pairs (this will make your algorithm simpler to write). 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.