Trending ▼   ResFinder  

ICSE Class X Mid-term 2023 : Computer Applications : Half yearly paper with Marking scheme

6 pages, 54 questions, 1 questions with responses, 1 total responses,    0    0
Amrita Pandey
Unison World School (UWS), Dehradun
+Fave Message
 Home > amritapandey1 >

Formatting page ...

Half Yearly Examination /Grade X / 27th Sep 22 /Tuesday/ Computer Applications /Morning ________________________________________________________________________________ Time Limit: 2 hours MM: 100 MARKING SCHEME Section A (40 Marks) Q.1 (i) Choose the correct answer and write. A .is an exit control loop in Java. (a) while (b) for (c) do-while (d) switch (ii) Which of the following is not a valid keyword? (a) for (b) int (c) System (d) far (iii) What is the final value stored in variable x? int a=7.7; double x-Math.abs(Math.floor(a)); (a) 7.0 (b) 8.0 (c) -7.0 (d) -8.0 (iv) The number of bytes occupied by int data type is ..byte/s. (a) 2 (b) 8 (c) 4 (d) None of these (v) (vi) The wrapper class to which boolean type belongs (a) Boolean (b) boolean (c) bool (d) BOOLEAN What will be the output of the statement: char c = ranjini .charAt( ani .length()); (a) n (b) j (c) a (d) i This document consists of 6 printed pages [20] (vii) Name the package that contains wrapper classes: (a) java.util (b) java.wrap (c) java.io (d) java.lang (viii) Predict the output of the following: Math.round(16.7) + Math.floor(7.1) (a) 24.0 (b) 20.0 (c) 25.0 (d) 21.0 (ix) Find the odd one out. (a) min() (b) ceil() (c) abs() (d) parseInt() (x) What is the return type of the x.concat(String str) method? (a) int (b) boolean (c) String (d) char (xi) A constructor: (a) is always public (b) never returns a value (c) never has the same name as the class name (d) both a & b (xii) In the below code snippet, what is the method s return type? int storage(String s) { return(s.length()*2); } (a) int (b) boolean (c) char (d) String (xiii) Wrapping up data and methods together as one unit is known as (a) Inheritance (b) Abstraction (c) Encapsulation (d) Polymorphism Give the output of the following: String a= 26.0 , b= 74.0 ; double c=Double.parseDouble(a); double d=Double.parseDouble(b); System.out.println(c+d); (a) 26 (b) 74 (c) 100.0 (d) 2674 (xiv) This document consists of 6 printed pages (xv) What will be the output: System.out.println( pencil .comapreTo( pen )). (xvi) Give the value of the following expression: 6-2+10%4+7 (a) 19 (b) 13 (c) 12 (d) 11 (xvii) What will be the value of x after executing the following statement: x=(x>y)?(y+x):(y-x) 5 if x=15, y=20 (a) 55 (b) 36 (c) 28 (d) 35 (xviii) .objects of a class can be created. (a) As many (b) One (c) Two (d) Five (xix) Identify the operator which gives the remainder as the output: (a) / (b) * (c) % (d) || (xx) Choose the correct explanation of the infinite loop. (a) It ends after five executions. (b) It never ends. (c) It never executes. (d) It stops after ten executions. Q.2 (i) Write the output: System.out.println("Incredible"+"\n"+"world"); (ii) Write java expression for the following: (a3+b3)+3ab(a-b)2 ((a*a*a)+(b*b*b)) + 3*a*b*(Math.pow((a-b),2)) [2] (iii) Rewrite the following using while loop: for(int i=1; i<=8; i=i-2) int i=1; { while(i<=8) System.out.println(i); {System.out.println(i) i=i-2;} } [2] (iv) Give the output: [2] incredible world This document consists of 6 printed pages [2] COLOMBIA .charAt(3)+ + COLOMBIA .charAt(0) OC (v) Write the prototype for the function storage() which accepts two String and one [2] integer value. This function returns nothing. void storage(String a,String b, int c) (vi) Evaluate the expression: int p=7, t=4; z= p++ + (p*r++ - r++) +p [2] 42 (vii) What is function overloading? (viii) Consider the following program and answer the below questions: class sample { void detail(int a, int b) { a=a+8; b=b+7; System.out.print(a); } public static void main() { int x=9, y=18; sample s1=new sample(); s1.detail(x,y); } (a) Identify actual parameters. x, y (b) What is the object and class name in the above code. s1, sample (a) Write the statement to convert the lowercase character to uppercase character. char ch=Character.toUpperCase(char c) (b) Write a statement to convert String type value to double type. double x=Double.parseDouble(String s) Rewrite the following using if-else: int x, y; char ch; char ch= (x>y) ? A : B ; if(x>y) ch='A'; else ch='B'; (ix) (x) same function name with different parameter lists. [2] [2] [2] [2] Section - B (Attempt any four questions in this section) Q.3 Create a class ACRoom that will model a room that needs to be cooled by an Air Conditioning Unit. This document consists of 6 printed pages [15] Following is the description of the class: Instance variable/data members: String Rname: to store the type of room double Rlength: length of the room double Rwidth: width of the room long capacity: air conditioning capacity of the room Member methods: ACRoom(): Non-parameterized constructor to assign numeric values to 0 and String values to . void accept(): to accept Rname, Rlength and Rwidth. void calCapacity(): to calculate the area of the room and decide the room conditioning capacity. void display(): To display all the details of the room type, length, width and conditioning capacity. Write a main method to create an object of the class and call the above methods. clas ACRoom{ String Rname; double Rlength, Rwidth; long capacity; ACRoom(){ Rname=""; Rlength=0.0; Rwidth=0.0; capacity= 0L;} void accept(){ Scanner sc=new Scnanner (System.in); sopln("enter values"); Rname=sc.next(); Rlength=sc.nextDouble(); Rwidth=sc.nextdouble();} void calCapacity() capacity=Rlength*Rwidth; void display() if(capacity<250) sopln("capacity is 5500"); if(capacity>=250 && <500)} void display(){ sopln("Room type"+Rname); } psvm(){ sample s1=new sample(); s1.accept(); s1.calCapacity(); s1.display(); Q.4 Write a program to accept a number and check whether it is a dudeney number or not. A number is called dudeney if the cube of the sum of the digits is equal to the number itself. Example: 512 = (5+1+2)3 = (8)3 = 512 [15] Q.5 Write a program to overload a function show() as per the details given below: (a) show(int x) to find the sum of the series: x + x/2 + x/3 + +x/10 (b) show() print the first ten terms of the given series: 1, 8, 27, . (c) show(int x, int n)- to find the sum of the series: x + x2 + x3+ ..+xn [15] Q.6 Write a program to accept a sentence from the user and print only the vowels from the sentence. Also, count and display the total number of vowels in the sentence. [15] Q.7 Write a menu driven program to perform the following tasks as per user s choice: (a) to accept two characters and print the sum of their ASCII codes. (b) To accept a number and print all its factors. [15] Q.8 Design a class to overload a function pattern(): (a) Pattern(String a) to accept a string from the user and display its in the reverse order. (b) Pattern() to display the following pattern: 5 [15] This document consists of 6 printed pages 44 333 2222 11111 Q.8 class overload2{ psvm{ pattern(String a) { for(int i=a.length()-1;i>=0;i--) sop(a.charAt(i); } pattern() { for(int i=5;i>=1;i--) {for(int j=5;j>=i;j--) sop(i);} sopln(); } }} .. . All the Best Q.4 class dudeney{ psvm(int n){ int s=0; int a=n; while(n>0{ int d=n%10; s=s+d; n=n/10; } if(a==(s*s*s)) sopln("deudeney number"); else sopln("not dudeney"); Q.6 class vowels { psvm(String s){ int v=0; int n=s.length(); for(int i=0;i<n;i++){ char c=s.charAt(i); if(c=='a'||c=='e'......) {v++; sopln(c);} } sopln(v) } q.5 class overlad1{ void show(int x) { double s=0.0; for(int i=1;i<=10;i++ s=s+(double)(x/i); } void show() int a=1; for(int i=1;i<=10;i++) sopln(a*a*a); void show(int x, int n ){ for(int i=1;i<=n;i++) s=s+Math.pow(x,i); }} class menu { psvm(){ Scanner sc=new Scanner(System.in); sopln("enter 1 for ASCII difference and 2 for factors"); int c=sc.nextInt(); switch(c) case 1: sopln("enter the two characters") char ch1=sc.next().charAt(0); char ch2=sc.next().charAt(0); sopln(ch1-ch2); break; case 2: sopln("enter the number"); int p=sc.nextint(); for(int i=1;i<=p;i++) if(p%i==0) sopln(i); } This document consists of 6 printed pages

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


Blackhole Gaming

(1)

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

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

 

amritapandey1 chat