ACTIVITY 2
Laboratory Application:
------------------------------------------------------------------------------------------------------------
Solve the following problems using Hands-on Application:
(Note: Write your explanations on how you create the program in a comment form.)
------------------------------------------------------------------------------------------------------------
1. Numbers contain in a serial code of a product are sometimes difficult to understand. Using one- dimensional array, create a program that reads three integer numbers and displays the numbers in a tab format so that a serial code now will be displayed correctly. If there are duplicate inputs, compute and display the sum for each input.
Sample Run:
=======================
Enter three numbers: 8 2 2
Numbers are: 8 2 2
Duplicate Inputs: 2
Sum is 4
=======================
2. Books in the Misamis University Library are arranged according to its code number given by a librarian. If the books belong to a department, it has a code of department_initial` control number (e.g. CCS 01). Create a program using a one-dimensional array that will group numbers in an array. If the range of numbers is 1 to 10, place it in Group 1, if the range of numbers is 11 to 20, place it in Group 2 and so on. There will be ten values as interval. Your program will only terminate once the input is 0 and below.
Sample Run:
========================
Enter an integer number: 22
22 belongs to Group 3.
Enter an integer number: 5
5 belongs to Group 1.
Enter an integer number: 0
Goodbye!
========================
3. Use one-dimensional array to solve the following problem. Read 20 integers in which each is between 10 and 100. As each number is read, print it only if it is not a duplicate of a number already read. If the number is a duplicate one, prompt the user a message then allow to ask another number. The program will only terminate if the input is not in the range.