Trending ▼   ResFinder  

ICSE Prelims 2018 : Computer Applications (Ashoka Universal School (AUS), Nashik)

4 pages, 40 questions, 29 questions with responses, 31 total responses,    2    0
Priya Jain
 Nasik 
+Fave Message
 Home > priya_jain_78 >   F Also featured on: School Page icse

Instantly get Model Answers to questions on this ResPaper. Try now!
NEW ResPaper Exclusive!

Formatting page ...

Preboard-II Class : X Time: 2hrs Subject : Computer Application Marks: 100mks Answer to this paper must be written on the paper provided separately. You will not be allowed to write during the first 15 minutes. This time is to be spent in reading the question paper. Time given at the head of this paper is the time allowed for writing the answers. This paper is divided in 2 sections. Attempt all questions of Section A and any 4 questions of Section B. The intended marks for questions or part of questions are given in square brackets [ ]. In programs give appropriate variable names and comments wherever necessary. Question 1: 1. Why is Java considered as OOP language? 2. Write the java statement for ( + 5 [2] ) 2 3. What is scanner class? Name functions of scanner class to read integer and String data type. 4. Identity which are invalid statements and Why a. long number=50,000; b. int a1=5; c. boolean var=1; d. byte a= =5; e. char f= a ; 5. What is the difference between Operator and Expression? Question 2: 1. Give output of the following code snippet String str="2015 throws IOException"; System.out.println (str.substring(0,4)+ str.substring(17,str.length())); System.out.println(str.substring(5,9)+str.lastIndexOf("a")); [2] [2] [2] [2] 2. What is the output of the following? double a=-5.0,b=-3.0,c=-6.0,d=25.60,e; e=Math.abs(Math.max(a,Math.max(b,c))); System.out.println(Math.ceil(d)+"\t"+e); [2] 3. Write output of the following:- [2] int a[]={2,4,6,8,10}; int k=2; int i=--a[2]; int j=a[++k]; System.out.println("The value of i is:"+i); System.out.println("The value of j is:"+j); 4. What do you understand by return statement in a method? If a number of return statements are used in a program, how many of them can be executed at a time? [2] 5. Write the output for the following java statement: int a=10, b=15, c=25; 6. System.out.println((a==(b+c))||(b== (a+c))&&(a!=(a+b))); Question 3: 1. What is an escape sequence? Give at least 2 example. 2. There can be only one catch block for a single try block.State true and false.Justify. G-X/Preliminary Exam-II/Computer Application Page 1 of 4 [2] [2] [2] 3. Differentiate between Overloading and Overridding [2] 4. Why is an object called an instance of a class? [2] 5. Predict the output for the following functions: [2] String st1="India"; String st2="wins"; String st3="World Cup Cricket 2019"; System.out.println(st3.compareTo(st2)); System.out.println(st3.charAt(0)+" " +st3.charAt(6)+" "+st3.charAt(10)); 6. Rewrite the following in ternary operator: [2] if( x= =50) amount = 500; else if(x<50) amount = 4.0/100*x; else amount=10.0/100*x; 7. Analyze the following program segment and determine how many times the loop will be executed. [2] Print the desired output. int x=5, y=2; while(x>=0) { x- -; y++; if(x= =y) continue; else System.out.println(x+ +y); } 8. (i) Write the prototype of a static method named cal that accepts two short type variable as it argument and returns an integer value. [1] (ii) Write the prototype of its overloaded function that takes two double values as formal parameters and returns the quotient of double type. [1] 9. Read the following method definition and answer the questions that follow: [4] static int solve(int a, Number num) { num.value*=a; return num.value; } i) State the output for the following function call: int c=solve(10,ob); if all the member variables for this object ab are initialized as 0 ii) Name the class and member variable as read in the method. iii) What type of method/ function it is? iv) Rewrite the code to print the value from the method itself. G-X/Preliminary Exam-II/Computer Application Page 2 of 4 Section B [Any 4] Use of Buffered Reader is compulsory wherever required. Question 4: Write a separate programs to perform the following task: a) Accept the value from the user and if that number is equal to the number generated by the computer then print Your are Lucky else print Better luck next time [8] Sample Input: Enter the number: 5 Sample Output : Number generated by computer: 4 Better luck next time. b) Write a method to print the sum of all even numbers and all odd numbers present in the number entered by the user. Sample Input : 54316 Sample Output : Sum of even number: 10 Sum of odd number: 9 [7] Question 5: [15] Write a program to accept any string and find the word contains maximum number of vowels. Question 6: [15] Accept the names of 'n' animals from the user a terminal window in a one dimensional array. Sort these animals alphabetically using the Selection Sort technique only. [E.g.: inputs= Cow, Cockroach, Crow, Cat, Camel, Calf, Centipede. outputs= Calf, Camel, Cat, Centipede, Cockroach, Cow, Crow.] Question 7: [15] Design class Bank with the following descriptions: Data members : name : to store the name of the depositor acno : to store the account number type : to store type of the account bal : to store the balance amount in the account Member functions : Bank( ) : constructor to assign the data members as 0 or null deposit( ) : to deposit an amount withdraw( int ) : to withdraw an amount after checking the balance (Minimum balance should be Rs. 500) print( ) : to print the all the details as follows: Name Acc No Bal G-X/Preliminary Exam-II/Computer Application Page 3 of 4 XX XX XX Write the main method to call above methods. Methods deposit and withdraw should be called according to the users choice. Question 8: [15] Write a program to overload the function to print the following shape Pattern() 1 12 1 2 3.. n terms Pattern (int n) 1 12 1 2 .... n terms Pattern (char x, int n) * ** * * *..... n rows Pattern (String s) Fine Fin Fi F Write main method to call above methods. Question 9: Define a class discount with the following description: [15] Instance variables/member data s: int code - to store the item s code. int qty - to store the quantity of the item purchased. int rate - to store the rate per item. Member methods/functions: void input() - to input and store the detail of an item. void compute() - to compute the amount to be paid by the customer and print the amount along with the gift to be presented to the customer according to the given data. Amount of purchase(Rs.) 100 and above but less than 500 500 and above but less than 1000 1000 and above Gift A key ring A leather purse A calculator Write main method to call above methods. G-X/Preliminary Exam-II/Computer Application Page 4 of 4

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


Sejal Gupta

(21)

Ansh Singh

(9)

Aruna Rander

(4)

*No name*

(3)

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2025 ResPaper. Terms of ServiceContact Us Advertise with us

 

priya_jain_78 chat