PPSB Computer Prelim
PPSB Computer Prelim
Question 2 [10]
Write a program to accept the year of graduation from school as an integer value from the user.
Using the Binary Search technique on the sorted array of integers given below, output the
message ‘Record exists’ if the value input is located in the array. If not, output the message
Record does not exist”.
(1982, 1987, 1993. 1996, 1999, 2003, 2006, 2007, 2009, 2010)
Question 3 [10]
Define a class to declare a character array of size ten, accept the character into the array and
perform the following:
• Count the number of lowercase letters in the array and print.
• Count the number of digits in the array and print
Question 4 [10]
Write a program to store 10 numbers in a single dimensional array and find the sum of all the
even numbers and odd numbers present in it.
Question 5 [10]
Write a program to input a sentence. Find and display the following:
(i) Number of words present in the sentence
(ii) Number of letters present in the sentence
Assume that the sentence has neither include any digit nor a special character.
Question 6 [10]
Write a program to accept a sentence. Display the sentence in reversing order of its word.
Sample Input: Computer is Fun
Sample Output: Fun is Computer
Question 7 [10]
Define a class to accept and store 10 names into the array and print the names which start with
‘R’ or ‘r’.