Write an application to allow user to enter a list of


Question.

Write an application to allow user to enter a list of integers, ends the input once the user enter 0. Then ask user to enter a target number, which should be an integer too. Then go through the list of integers, find two integers that sum up to the target number, then return their indexes, where index1 < index2. If no such integer pair can be found, output "There is no two integers sum up to your target number!" (hint, nested for-loop)
Example 1:
Input integers:
1, 2, 3, 5, -9
Target number:
8
Output indexes:
Index1: 3
Index2: 4
Example 2:
Input integers:
1, 6, 3, 5, -9
Target number:
11
Output indexes:
Index1: 2
Index2: 4

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write an application to allow user to enter a list of
Reference No:- TGS02392130

Now Priced at $10 (50% Discount)

Recommended (98%)

Rated (4.3/5)