Trending ▼   ResFinder  

ICSE Notes 2018 : Computer Applications (Cambridge Public School, Bangalore)

13 pages, 155 questions, 107 questions with responses, 152 total responses,    7    0
Sparsh Agarwal
Indian School of Mines University (ISM), Dhanbad
B.Tech
+Fave Message
 Home > sparsh_arsenal >   F Also featured on: School Page icse and 1 more

Formatting page ...

Subject: Computer Applications STD: X ICSE Practice Paper for the Board Examination March 2018 I. Represent the following Mathematical expressions as Java expressions:(1) 4 x (y) (2) 2x2 +3 x (x+y) (3) |x| + a2 + b 2 (4) S 30 + 30 (5) 0.05a3 +b2 (a+b) II. Evaluate the following and write the output:(1) int a=5, b=6, c=2; System.out.println (a+b%c-a*b); System.out.println (c/a + c%a); (2) int x=-4, y=-2; x*=x++ + y++ - ++x; System.out.println ("x= "+x+ "\n y= "+y); (3) char x= 'B '; int y=5; System.out.println (x++%y++ + ++x); System.out.println (x+","+y); (4) int m=100, n=150, k=200; System.out.println ("Output is "+(m%10==n%10)); System.out.println ("Output is "+!(k>m || K%m==0)); (5) int a=20, b=18; char c='a', c1='b'; System.out.println System.out.println System.out.println System.out.println System.out.println System.out.println System.out.println a=b=++a; System.out.println ("Examination "+a+b); ("Output is "+a+c); ("Output is "+(a+c)); (a+c+" is the output"); (c++); (c + b++); (c+" "+b); (a+" "+b); (6) int x=1000, y=500; if(x+y%3==0) System.out.println (x+=y); else System.out.println (x-=y); (7) Write the Output: if (i) char op='a' (ii) char op='d'; switch (op) { case 'a': System.out.println ("case a executed"); case 'b': System.out.println ("case b also executed due to absence of break in case a"); break; case 'c': System.out.println ("case c executed"); default: System.out.println ("User s Input is not matching"); } 1 (8) int x=10, y=-5; if(x>0) if(y>0) System.out.println (x+" "+y); else System.out.println (Math.abs (y)+x); else System.out.println (Math.abs (x)+Math.abs (y)); (9) analyze how many times the following loop gets executed and write the output: (a) int x=10, y=2; while (y<=x) { System.out.println (x+","+y); if(x%++y==0) break; } (b) char c='a' do { System.out.println (c++); if (c%10==0) break; } while (true); (c) for (int a=100; a>=1; a-=10) { if (a%4==0) continue; System.out.println (a); } (d) for (int i=1; i<3;i++) { for (int j=1;j<6;j++) { System.out.println (i+","+j); if(j%2==0) break; } } (10) System.out.println (Math.ceil (-6.5)); System.out.println (Math.sqrt (Math.pow (100%10, 4))); System.out.println (Math.floor (Math.abs (-8.998))); System.out.println ((int) (Math.random () *10)); System.out.println (Math.rint (5.78)); System.out.println (Math.max (-10, -100)+ Math.min (10, 10/20)); (11) String x="Fun World", y="Water World"; System.out.println (x.length ( ) + y.length ( )); System.out.println (x. charAt (y.length ( )/2)); System.out.println (y.indexOf ('W', 1)); System.out.println (x.lastIndexOf ('N')); System.out.println (x.substring (0, 4).concat ("Cinemas")); 2 System.out.println System.out.println System.out.println System.out.println (x.compareTo (y)); (y.substring (6).toUpperCase ( )); (x.substring (5, x.length ())); ("Independence".replace ('e', 'E')); (12) String s="12345", s1="13.456"; int x=12; double y=33.451; System.out.println (Integer.parseInt (s) /10 + Integer.valueOf (s) % 10); System.out.println (s.length ( ) + s1.length ( )); System.out.println (s.compareTo (s1)); System.out.println (s1.indexOf ('.')); System.out.println (Character. isLetter (s1.charAt (2))); System.out.println (Character. isUpperCase ((char)(97-32))); System.out.println (Character. toLowerCase ("ABCD".charAt(3))); System.out.println (Integer.toString (x) + String.valueOf (y)); System.out.println (Integer.toString ((int)y).lastIndexOf ('3')); System.out.println (Character.isWhitespace ('\n')); System.out.println (Character.isLetterOrDigit ('8')); System.out.println (Double.parseDouble (s)); System.out.println (Integer.parseInt (s) /1000); (13) int a [ ]= {10, 20, 22, 24, 32, 44 }; char [ ] b={'a', 65, 98, '$', '6', 'w', 'x', 'y'}; String c [ ]={ "MICROMAX","SAMSUNG","NOKIA","RELIANCE"}; System.out.println (a[0]++ + a[a.length-1]-- + a[0] + a[5]); System.out.println (b.length + c.length); for (int i=c.length-1; i>=c.length/2; i--) System.out.println (c[i]); System.out.println (c[1].toLowerCase ( ).charAt (3)); System.out.println (c[0].startsWith ("MIc")); System.out.println (c[2].compareTo ("NOISE")); System.out.println (b[1] + " "+b[3]); ++b[5]; System.out.println (b[5]==b[6]); System.out.println ((int)b[4]); System.out.println (Character.isUpperCase (b[2])); System.out.println (a[0]+a[2]%a[3]==a[4]?a[4]/2: a[4]/3); (14) (a) Re-write the following using while loop:int a=1, b=12; do { System.out.println (b++*2); a++; } while (a<=5); (b) Re-write the following using for loop:int m=100; while (true) { System.out.println (m/2); m-=10; if(m%4==0) break; } 3 (c) Re-write the following using nested if statements:if (x%10==0 & y%10==0) System.out.println ("Ends with zero"); else System.out.println ("Does not ends with zero"); (d) Re-write the following using else if statements:switch (a) { case 10: case 12: System.out.println ("********"); break; case 0: System.out.println ("@@@@@@"); break; default: System.out.println ("Input not matching"); } (15) Write Java Statements for the following:(1) Assign your class & Section to a variable of appropriate type. (2) To assign the number 12.3 using float data type. (3) Check whether the value of m is divisible by n and q. (4) To display the text "\\ICSE EXAMINATION 2018//". (5) To add value of x and y and initialize to y using short hand operator. (6) To check the number n is odd using Logical NOT operator. (7) To find the sum of pre-increment of a and post-decrement of b. (8) Using ternary operator check the number x is a single digit ve odd or single digit ve even number. (9) To display the last two digits of a number x. (10) Convert the string "18" to a number. (11) Convert the number 12.3f to String. (12) Check the character ch is an alphabet or a digit. (13) Convert the character 'G' to lowercase without using a library function. (14) Define a class Laptop with the following data members: String brand; int price; (15) Define a default constructor for Q14. (16) Define a parameterized constructor for Q14. (17) Invoke (call) the default and parameterized constructor defined in Q15 and Q16. (18) To create an object colors of the class Channel. (19) Function/method prototype of the function Calc which accepts an integer and double argument which displays the sum of both the arguments. (20) Function prototype for the function Increment which accepts an integer argument and returns the value after increasing it by 100. (21) Function prototype for the function Display which accepts an integer array and returns the sum of all the integers. (22) Write a for loop which prints even numbers from -100 to -50. (23) Convert the number -20 to positive. (24) Convert the sum of 12 and12.45 to int. (25) Initialize the string "Amazon" using new keyword. (26) Extract the character at the middle index position of the String str. (27) Extract the 2nd character from the string x. 4 (28) Concatenate the first two and the last two characters of the string s. (29) Find the position of first occurrence of the character ch in the String s. (30) To call the class String from the package lang. (31) To import all the classes from the sub-package A1 which is present under A package. (32) To initialize first five uppercase consonants in an array. (33) Consider the value of a is 12 and b is 10, exchange the values of a and b. (34) Display the 4th element of an array arr. (35) Find the total characters present in the string element of an array x[ ] at 3rd index position. (36) Copy last three elements of the array x[ ] to array y [ ] using arraycopy ( ). (37) Create a string array d of size 100. (38) Find the sum of the lengths of a[ ] and the String st. (39) Initialize the values true, false, false and true in an array of appropriate type. (40) To read characters encountered by a space character using Scanner class. (41) To read characters till the user press enter key using Scanner class. (42) To read a single character using Scanner class. (43) To convert the character array c[ ] to String. (44) To remove the space before and after the string s and assign it to string s1. (45) To check 5th element of an array a[ ] is divisible by 6. (16) Identify the various tokens from the following:(a) new (b) abc1$ (c) Void (d) * (e) ( ) (f) & (17) Study the following code and answer the questions that follow:class Exam { static int x, y; int a, b; public Exam (int a, int b) { this.a=a; this.b=b; } public void display ( ) { int c=a++ + b++; System.out.println (c); System.out.println (a+b); } public static void main ( ) { Exam e=new Exam (100, 50); e.display ( ); } } Questions: (a) Identify the class variables. (b) Identify the instance variables. (c) Identify the formal parameters. (d) Identify the actual parameters. 5 (e) Identify the local variables. (f) How do you assign values for x and y in a different class? (g) What is the output of the above code? (h) Which unit if class gets invoked when object is created? (18) Calculate the memory capacity of the following:(a) int x=234567; (b) char x='\u000c', y='*'; (c) String s="Wonderful year 2018"; (d) int x[ ]={1,2,3,4,5}; (e) double d[ ]=new double [50]; (f) class abc { int x; float y; char z; public static void main ( ) { abc obj=new abc ( ); } } Find the capacity of an object obj (19) Name the error and categorize as Syntax/logical/runtime: (a) int x=12.34; (b) int a[ ]={1,2,3}; System.out.println (a[a.length]); (c) int x; int x=100; (d) if(x>100); System.out.println ("More than 100"); else System.out.println ("Less than 100"); (e) if(x=='+') System.out.println (a*b); (f) switch (op) { case 1: op++; break; case 1: ++op; break; case 3: --op; break; } (g) int a=12,b=14; System.out.println (Math.sqrt (a-b)); (h) system.out.println ("Printing "); (i) char c='a'; String s=c; (j) for (int x=0;x<10;x++); System.out.println(x); 6 (k) String s="abcd"; System.out.println (s.charAt (s.length ( ))); (20) Debug the following:(a) Void display ( ); System.out.println ("Hello World"); (b) int x=10, double y=12.3, float f=1.2; (c) void calc (int x; int y) { int c=x*y; return c; } (d) int x==10; x=+10; (e) int a=b=c=d=100; (f) string s="Delhi; System.out.println (s.charAt(3).toUpperCase ( )); (g) Math.maximum (10, Math.minimum (4,5)); (h) int a[10]={1,2,3,4,5,6,7,8,9,10}; (i) int x []=new x[10]; (j) int y[]=new int[5]; y[]={1,2,3,4,5}; (k) for (int a=10, a<10, ++a) System.out.println (a); (l) char x="classic".replace ('c', 'C'); (21) Identify the type of conversion (Implicit/Explicit) (a) int a='S'; (b) char b=67; (c) System.out.println (++b); (d) int a=12; double b=12.34; int c= (int)(a+b); (e) int a=10, b=20; String s="Output is "; s=s+a+b+c; (f) String a="11"; int n=Integer.parseInt (a); (g) int a=1, b=2; float c=1.2f; double d=12.3; char e='b'; System.out.println (a+b+c+d+e); (22) Identify the following as Assignment statement, Object creation statement, Function call statement, Unary statement: (a) ++x[i] (b) obj.display ( ); (c) a+=b; (d) a=10; (e) School s=new School ( ); 7 (23) Identify whether the following are called by value/reference: (a) obj.calc (1,2,3,4,5); (b) int a[]={1,2,3,4,5}; obj. find (a); (24) Arrange the operators from least to the highest priority:Arithmetic +, &&, %, ++, !=, !, >=, += (25) Identify the pakage to which the following classes belong to: System, String, InputStreamReader, Scanner, Float, Long, Character, Math. Programs 1. Define a class Commission having the following description:Data Members/Instance Variables: String name salesman name int amount sale amount double comm commission amount Member functions: (i) Commission ( ) Initializes the default values for name and amount. (ii) void input ( ) Accept values for name and amount. (iii) void compute ( ) Calculate the commission amount based on the following conditions: Sale Amount Commission % More than Rs.1,00,000 25% From Rs.80,000 to Rs.1,00,000 22.5% From Rs.60,000 to Rs.79, 999 20% From Rs.40,000 to Rs.59,999 15% Less than Rs.40,000 12.5% (iv) void Output ( ) -Display the information as per the given format: Name Sale Amount Commission Amount ----------------Write a main ( ) method to create an object and call the above member functions. 2. Define a class Library having the following description:Data Members/Instance Variables: String name Name of the book int price printed price of the book int days number of days for which fine is to be paid double fine fine to be paid Member Functions:(i) Default constructor to initialize name to " ", price to 0, days to 0. (ii) Parameterized constructor to initialize values for name, price and days (iii) void calculate ( ) compute the fine amount based on the following slab: Days Fine First Seven days 25 paise per day Next Eight days 40 paise per day Next Fifteen days 60 paise per day More than Thirty days 80 paise per day 8 (iv) void display ( ) - Display the name, days and the fine amount. Write a main ( ) method to create an object and call the above member functions. 3. Define a class Tax having the following description: Data Members: PanNo - String Age - Integer Mobile_No - long Annual_Income - integer Tax_Amt - double Member functions: (i) Parameterized constructor to initialize values for PanNo, Age, Mobile_No and Annual_Income (ii) void compute_Tax() To calculate the tax amount based on: ANNUAL INCOME RANGE PERCENTAGE OF TAX >1.9 lakh and <=2.5 lakh 5% >2.5 lakh and <=5 lakh 10% >5 lakh and <=10 lakh 15% >10 lakh 30% void display() Display all the details in different lines. Write a main() method to create an object and call the functions. 4. Define a class Vehicle_Loan having the following description:Data Members/Instance variables: int time Time for which loan is sanctioned. double principal Amount sanctioned double rate Rate of interest double interest Interest amount double amount Amount to pay after given time Member Functions:(i) void input ( ) Accept values for time, principal, and rate (ii) void calculate ( ) Calculate the interest amount to be paid by the customer based on Number of years Rate of interest Formulas: Up to 5 years 15% More than 5 years and up to 10 years 12% Above 10 years 10% interest = (principal rate time) 100 = + (iii) void display ( ) - Display the interest and the amount. Write a main() method to create an object and call the functions. 9 5. Define a class count having the following description: Data Members/Instance Variables: String s - stores a line of text and converts to uppercase. int vc - counts the total number of vowels String r - stores the characters of s from last index to 0th index. Member Functions:(i) void accept ( ) Accept input for s (ii) void count_vowels ( ) Count the vowels in s. (iii) void reverse ( ) reverse the string s (iv) void display ( ) Display the vowel count and the reversed string. Write a main() method to create an object and call the functions. 6. Design a class to overload the function Calculate ( ) as follows:(i) double calculate (int x, int y) accepts two integer arguments and finds and returns the result of the following. + + ! + ! Where ! stands for factorial of a number. It is calculated by multiplying all the numbers from 1 up to the number [For Example: 4! Is 1 x 2 x 3 x 4 =24] (ii) void calculate (int cm) accepts an integer arguments and converts centimeters to Meters and displays the result. [Note: 1m = 100cm] (iii) double calculate (double degree) accepts an integer argument and returns the tangent value of the argument. 7. Design a class to overload the function Java_Lib ( ) as follows: (a) void Java_Lib (int a, int b, int c, int d) accepts four integer arguments and finds And displays the highest value. (b) void Java_Lib (String str, int pos) accepts a string and integer argument and Displays the character at the specified index position. Display error message if pos is out of range. (c) void Java_Lib (char ch) Converts and displays the character in lowercase if it is in uppercase and vice-versa. [Use Library functions] 8. Design a class to overload the function Pattern as follows:(i) void pattern (int rows, int columns, char c) accepts three arguments and displays The Pattern as follows: Input value for rows=3 Input value for columns= 6 Input value for c='$' Output: $$$$$$ $$$$$$ $$$$$$ 10 (ii) void pattern ( )- displays the following pattern ++++++ +++++ ++++ +++ ++ + 9. Design a class to overload the function Series ( ) as follows:(a) void Series ( ) Finds and displays the sum of the following series = 2 4 + 6 8 . 20 (b) void Series (int n) accepts the number of terms and finds and displays the sum of the Series Sum = 1 1 2 3 4 9 + + + up to n terms 10. Design a class to overload the function string_manip ( ) as follows:(i) void string_manip (String s) accepts a string argument and displays the count of symbols present in it. Input for s="abc@yahoo.co.in" Output: 3 (ii) void string_manip (String s, char c) accepts two arguments and displays the Character c present in the string s. Input for s="Mississippi" Input for c='s' Output: ssss 11. Design a class to overload the constructor function Arithmetic as follows:(i) public Arithmetic (int x, int y) Displays the sum of the Quotient and the remainder Value by dividing higher value by lower value of x and y. If the denominator is 0, then display error message "Cannot divide by zero" (ii) public Arithmetic (double x, double y )- Finds and displays the sum of decimal part of x and y. Input for x=12.35 Input for y=12.5 Output: 40 Write a main () method to create an object to invoke the above constructors 12. Using switch statement, write a menu driven program to perform the following:1. To input a number and display the square root value of each digit. 2. To display the series 1, 4, 27, 256, 625 Display appropriate error message for invalid choice. 13. Using switch statement, write a menu driven program to perform the following:1. To find the sum of series 2 + 4 + 6 + . . 10 , where a is input by The user. 2. To input a number and check it is a perfect cube. For Example: Perfect cubes are 8, 64, . Display appropriate error message for invalid choice. 11 14. Using switch statement, write a menu driven to perform the following:1. Pattern1 2. Pattern2 If the user s choice is 1, then display ABCDEF BCDEF CDEF DEF EF F If the user s choice is 2, the display BLUEJ LUEJB UEJBL EJBLU JBLUE Display appropriate error message for invalid choice. 15. Write a program to input a line of text and display the string as follows:Sample Input: Plotter is an output device Sample Output: device output an is Plotter 16. Write a Program to input a string and convert to lowercase and perform: (a) Check the starting and the ending characters are vowels. (b) replace each character by adjacent character [replace the character z by a] For example: Input for string is zebra Output: afcsb 17. A five-digit integer is said to be friendly if the left most digit is divisible by 1, the left most 2-digits are divisible by 2, the left most 3-digits are divisible by 3, the left most 4-digits are divisible by 4 and the left most 5-digits (the number itself) is divisible by 5. Write a Java Program to input a number and perform the following: Check the number is a five digit number, if not five digit display error message. If it is five digit, then check it is a friendly number or not based on the above description and display the output as friendly number, otherwise display the output as not a friendly number. Example: Input Number: 42325 Output: 42325 is a friendly number 4 is divisible by 1, 42 is divisible by 2, 423 is divisible by 3, 4232 is divisible by 4 and 42325 is divisible by 5. 18. As of the year 2008, a 10-digit phone number that begins with either 800, 888, 877 Or 866 followed by other seven digits is Toll free. Write a Java Program to perform the following: Input a number. Check it is a 10-digit number, If not 10-digit, display the message "Invalid Number ". If it is 10-digit number then check the number is a Toll free number or not based on the above description, otherwise display the message as "Invalid Number". Example (i): Input Value for n=8005651009 Output: It is a Toll free number. 12 Example (ii): Input Value for n=8775651009 Output: It is a Toll free number. Example (iii): Input Value for n=8445651009 Output: Invalid number. 19. Write a program to input 10 numbers in an array and display all the numbers which are prime. 20. Write a program to details of 10 employees such as employee name, basic salary in Two Different arrays. Increment the salary of each employee by 15% and store it in a different array. Display the output in the following manner: Sl.No Name Basic Salary Salary after increment 1 ------------------21. Write a program to input 10 names and the corresponding PF number in two different Arrays. Accept input for a name from the user and display the corresponding PF Number along with the name if found in the array Using Linear Search technique. Display error message if not found. 22. Write a program to input 10 cricketer s names and their corresponding runs scored in two different arrays. Search for a name to display the corresponding runs along with the name if fond in the array using Binary search technique. Display error message if not found. [Assume the array to be searched is in ascending order] 23. Write a Java Program to perform binary search on a list of numbers given below, to search for a number input by the user. If it is found display the number along with its position, otherwise display the message Search element not found 44.5, 42.5, 40.5, 35.5, 33.5, 30.5, 25.5, 20.5, 10.5, 5.5 24. Write a program to input 10 names and their phone numbers in two arrays. Arrange The names in ascending along with their phone numbers using bubble sort and display the output as: Names Phone numbers -------25. Write a program 20 numbers in an array and arrange them in ascending order using Selection Sort and display the sorted array. ______________________ 13

Formatting page ...

Related ResPapers
ICSE Class X Notes 2024 : Computer Applications
by anivinutha 
ICSE Notes of all important string programs 2018 : Computer Applications (St. Francis School (SFS), Madhurawada, Visakhapatnam)
by alladee3 
ICSE Class X Notes 2022 : Computer Applications : dbms
by cairos 
ICSE Class X Notes 2025 : Computer Applications (Ebenezer International School (EISB), Bangalore) : Array
by _vaidikk 

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


Siddhant Joshi

(59)

Aayush Joshi

(30)

Abhijna Choodi

(19)

Abhigyan Agarwal

(16)

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

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

 

sparsh_arsenal chat