Formatting page ...
COMPUTER APPLICATIONS SPECIMEN PAPER-1 Time:2hrs F.M-100 SECTION-A(40 Marks) Attempt all questions from this section Question 1: [2x5=10] a) What is an exception? Some Keywords related to exception? b) c) d) e) Differentiate: Control Statement and Control Variable. What are object datatypes ? Give examples. What are class variables? How are they created? What are the special characters used is java? What is its purpose? Question 2: [2x5=10] a) b) c) d) e) Array creation is a two staged process. Explain with examples. What is wrapper class? What is its purpose? What is the use of .obj file in java? Differentiate: throw & throws. What makes the main() unique? What if it was eliminated? Question 3: [20] a) Write Java statements for the following: [2] i. To store section of a student through scanner class. ii. Create a variable and store take the phone number of a student as input. b) Write the default value of: [3] i. String ii. Character iii. Local variable c) Write the end datatype and resultant of: [4] i. S= Math.pow(2,6)% A+ A + B + C +Math.round(2.5); ii. K= Stewart.charAt(3)+Math.sqrt(625)+Odisha.substring(HappyIndia.indexOf(Bhubanes war.CharAt(Math.round(6.25)); d) Is there provision of any constructor if there is no user defined constructor in a program? Why? [2] e) What kind of variables a class consist of? [2] f) Write equivalent statement using ternary operator and display the output: [3] If( D >Stewart.charAt(3)) { If(Math.round(9.325)>Math.rint(9.325)) System.out.println( Party ); else System.out.println( Boring ); } else if(Math.sqrt( d )>Math.pow(10,0)) { System.out .println( Lets go out ); } else { System.out.println( Stay at home ); } g) char a=[ A , D , F , a , c ];int i=1; [2] i. System.out.println(++a[i++]+--a[--i]); ii. System.out.println(--a[--i + i++ +i--]-i++ + ++i); h) Write the prototype of Math.round() and substring() method of String class. [2] Section-B(60 marks) Attempt any four questions from this section. Variable description is necessary. Question 4: [16] Take a string as input .Check whether it is even or not. Then check whether palindrome or not. If it is palindrome then check whether the combination of the 1st and last digit is equal to the middle two digits or not. Display with appropriate messages in every stage. Question 5: [16] Check whether a number is mystery number or not. A number is said to be mystery number if the sum of 1s in its binary form is even and the number is palindrome and the sum of its first and last digits reduced to 1 digit equals the middle digit. Question 6: [16] Take name and phone numbers of 30 students as input in an array. Then arrange according to alphabetical order of their names from A-Z. Then take a name as input and display its details. Question 7: [16] Mr. Verma took a telephone connection as per the given scheme: Units Consumed Price First 100 units nil Next 200 units next 20% of the call made Next 300 units next 30% of the calls made Next 500 units next 40% of the calls made Above next 500 units next 50% of calls made Calculate his bill amount due. If the amount exceeds 1000 a discount of 20% is to be given on the whole else he would have to pay the bill as it is. Question 8: [16] Define a class AlphaArrange having the following description: Member data: String a,b; int c,d; Member method: void take() public void arrange() private void disp() Write a program to take a string as input and then arrange it according to its alphabetical order of its words. Then display the new string. Question 9: [16] Create overloaded methods named void determine_output() to perform the following task: Check palindrome or not Check whether palprime or not Check H.C.F of two numbers Write a menu driven program to do these task as per the user s choice and display volume in respective functions. void determint_output(int) for palindrome(original number equals to the number obtained by reversing its digits) void determine_output(int) for palprime( number should be palindrome as well as prime) void determine_output(int,int) for calculating hcf of two numbers
|