Professional Documents
Culture Documents
Lab 9
Lab 9
I. Guidelines:
o You should be working individually.
o Samples of input/output cases for some problems are provided.
o Make sure to submit your files to Google Classroom before the deadline. Otherwise your
work won’t be considered for grading.
o You should submit one folder that contains only your .cpp files. The folder should be named
as “Full name – Lab 8”.
A. Graded Problems:
Sample I/O:
2. Write a program that declares an array of length 10, fill it by numbers from the user and
determine the number of occurrences of a number read from a user in the array.
Sample I/O:
3. Write a program that declares an array of length 10 and fill it by numbers from the user. The
program should then print the following:
o The maximum number in the array
o The minimum number in the array
o The sum of the odd numbers in the array
o The average of even numbers in the array.
Sample I/O:
Sample I/O:
B. Bonus Problems:
5. Write a program that declares an array of length 10, fill it by numbers from the user and then sort
the array in increasing order. The program then should print the array after sorting.
6. Write a program that declares an array of length 10, fill it by numbers from the user and then sort
the array in decreasing order. The program then should print the array after sorting.