Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

West Visayas State University

COLLEGE OF INFORMATION AND COMMUNICATIONS TECHNOLOGY


Luna St., La Paz, Iloilo City 5000
Iloilo, Philippines
* Trunkline: (063) (033) 320-0870 loc. 1403 * Telefax No.: (033) 320-0879 Acc. No.: M2700903PM
* Website: www.wvsu.edu.ph * Email Address: cict@wvsu.edu.ph
PHI-18939-2-QM

Activity 6
Instructions:
The filename of this activity is Activity6 – (Complete name). Then save this activity on the
Google Drive. Place your code at the end of these problem.

Problem 1:
Write any program that implements classes and objects.

Problem 2:
Write a method, removeAt, that takes three parameters: an array of integers, the length of the
array, and an integer, say, index. The method deletes the array element indicated by index. If index
is out of range or the array is empty, output an appropriate message. (Note that after deleting the
element, the array size is reduced by 1.) You may assume that the array is unsorted.

10. Write a version of the insertion sort algorithm that can be used to sort a string Vector object.
Also, write a program to test your algorithm. 11. Write a version of a binary search that can be used
to search a string Vector object. Also, write a program to test your algorithm. (Use the selection sort
algorithm you developed in Programming Exercise 8 to sort the Vector.) 12. Redo the Programming
Example Election Results so that the names of the candidates and the total votes are stored in
Vector objects

You might also like