ICSE Class 10 Computer Applications ( Java ) 2014 Solved Question Paper

Similar documents
COMPUTER APPLICATIONS

COMPUTER APPLICATIONS

Using Java Classes Fall 2018 Margaret Reid-Miller

Introduction to Computer Science Unit 2. Notes

Java Foundations: Introduction to Program Design & Data Structures, 4e John Lewis, Peter DePasquale, Joseph Chase Test Bank: Chapter 2

ICSE Class 10 Computer Applications ( Java ) 2010 Solved Question...

Introduction to Computer Science Unit 2. Notes

COMPUTER APPLICATIONS

Review Chapters 1 to 4. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013

Midterm Examination (MTA)

Chapter 4: Control Structures I

AP CS Unit 3: Control Structures Notes

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

Lab5. Wooseok Kim

CSCI 2010 Principles of Computer Science. Data and Expressions 08/09/2013 CSCI

ICSE Class 10 Computer Applications ( Java ) 2012 Solved Question...

Chapter 4 Mathematical Functions, Characters, and Strings

Programming with Java

Getting started with Java

ICSE Class 10 Computer Applications ( Java ) 2013 Solved Question...

CSC Java Programming, Fall Java Data Types and Control Constructs

Key Concept: all programs can be broken down to a combination of one of the six instructions Assignment Statements can create variables to represent

Operators and Expressions

Module 4: Characters, Strings, and Mathematical Functions

COE 212 Engineering Programming. Welcome to Exam I Tuesday November 11, 2014

AP Computer Science A

Section 2: Introduction to Java. Historical note

Chapter 2: Data and Expressions

H212 Introduction to Software Systems Honors

when you call the method, you do not have to know exactly what those instructions are, or even how the object is organized internally

Question: Total Points: Score:

Advanced Object Concepts

Full file at

Lab5. Wooseok Kim

Programming: Java. Chapter Objectives. Control Structures. Chapter 4: Control Structures I. Program Design Including Data Structures

What did we talk about last time? Examples switch statements

In this chapter, you will:

Lecture 6. Assignments. Java Scanner. User Input 1/29/18. Reading: 2.12, 2.13, 3.1, 3.2, 3.3, 3.4

Object Oriented Programming. Java-Lecture 1

Chapter 2: Data and Expressions

Data and Expressions. Outline. Data and Expressions 12/18/2010. Let's explore some other fundamental programming concepts. Chapter 2 focuses on:

JAVA OPERATORS GENERAL

The Math Class. Using various math class methods. Formatting the values.

CONTENTS: Compilation Data and Expressions COMP 202. More on Chapter 2

Jump Statements. The keyword break and continue are often used in repetition structures to provide additional controls.

CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals

MIDTERM REVIEW. midterminformation.htm

A variable is a name for a location in memory A variable must be declared

Mathematical Functions, Characters, and Strings. CSE 114, Computer Science 1 Stony Brook University

Example: Monte Carlo Simulation 1

Topics. Chapter 5. Equality Operators

Lecture 6. Assignments. Summary - Variables. Summary Program Parts 1/29/18. Reading: 3.1, 3.2, 3.3, 3.4

Java Tutorial. Saarland University. Ashkan Taslimi. Tutorial 3 September 6, 2011

AP Computer Science Unit 1. Writing Programs Using BlueJ

COMP-202B - Introduction to Computing I (Winter 2011) - All Sections Example Questions for In-Class Quiz

Chapter 3: Operators, Expressions and Type Conversion

M105: Introduction to Programming with Java Midterm Examination (MTA) Makeup Spring 2013 / 2014

Pace University. Fundamental Concepts of CS121 1

Language Features. 1. The primitive types int, double, and boolean are part of the AP

Full file at

Mathematical Functions, Characters, and Strings. CSE 114, Computer Science 1 Stony Brook University

Oct Decision Structures cont d

Eng. Mohammed S. Abdualal

Outline. Parts 1 to 3 introduce and sketch out the ideas of OOP. Part 5 deals with these ideas in closer detail.

CSC 1051 Algorithms and Data Structures I. Midterm Examination February 25, Name: KEY A

4. Java Project Design, Input Methods

COMPUTER APPLICATIONS

CSC Algorithms and Data Structures I. Midterm Examination February 25, Name:

1.00 Introduction to Computers and Engineering Problem Solving. Quiz 1 March 7, 2003

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal

COMP 202. Built in Libraries and objects. CONTENTS: Introduction to objects Introduction to some basic Java libraries string

Jump Statements. The keyword break and continue are often used in repetition structures to provide additional controls.

Java Basic Programming Constructs

Section 004 Spring CS 170 Exam 1. Name (print): Instructions:

Interpreted vs Compiled. Java Compile. Classes, Objects, and Methods. Hello World 10/6/2016. Python Interpreted. Java Compiled

double float char In a method: final typename variablename = expression ;

boolean, char, class, const, double, else, final, float, for, if, import, int, long, new, public, return, static, throws, void, while

Computer Programming, I. Laboratory Manual. Experiment #4. Mathematical Functions & Characters

Tester vs. Controller. Elementary Programming. Learning Outcomes. Compile Time vs. Run Time

Example. Write a program which sums two random integers and lets the user repeatedly enter a new answer until it is correct.

Introduction to Programming Using Java (98-388)

COMP-202 Unit 4: Programming With Iterations. CONTENTS: The while and for statements

Chapter 3. Selections

Important Java terminology

Last Class. While loops Infinite loops Loop counters Iterations

Elementary Programming

Entry Point of Execution: the main Method. Elementary Programming. Learning Outcomes. Development Process

CSC 1214: Object-Oriented Programming

Assoc. Prof. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Chapter 2 ELEMENTARY PROGRAMMING

COMP-202: Foundations of Programming. Lecture 3: Boolean, Mathematical Expressions, and Flow Control Sandeep Manjanna, Summer 2015

To define methods, invoke methods, and pass arguments to a method ( ). To develop reusable code that is modular, easy-toread, easy-to-debug,

Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 3

Basic Operations jgrasp debugger Writing Programs & Checkstyle

COMP 202 Java in one week

Date: Dr. Essam Halim

CS111: PROGRAMMING LANGUAGE II

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal

Basic Programming Elements

Operators. Java operators are classified into three categories:

Transcription:

1 of 10 05-11-015 16:1 ICSE J Java for Class X Computer Applications ICSE Class 10 Computer Applications ( Java ) 014 Solved Question Paper ICSE Question Paper 014 (Solved) Computer Applications Class X SECTION A (40 Marks) Answer all questions from this Section Question 1. (a) Which of the following are valid comments? [] (i) /* comment */ (ii) /*comment (iii) //comment (iv) */ comment */ (i) and (iii) are valid comments. (i) is a multi line comment and (iii) is a single line comment. (b) What is meant by a package? Name any two Java Application Programming Interface packages. [] Related classes are grouped together as a package. A package provides namespace management and access protection. Some of the Java API packages java.lang, java,util and java,io (c) Name the primitive data type in Java that is: (i) a 64-bit integer and is used when you need a range of values wider than those provided by int. (ii) a single 16-bit Unicode character whose default value is \u0000 [] (i) long (ii) char (d) State one difference between floating point literals float and double. [] (i) Float requires 4 bytes of storage while double requires 8 bytes. (ii) Float is of single precision while double is of double precision. (e) Find the errors in the given program segment and re-write the statements correctly to assign values to an integer array. [] 1 int a = new int( 5 ); for( int i=0; i<=5; i++ ) a[i]=i; The corrected program segment is 1 int a = new int[5]; for( int i=0; i<=4; i++ ) a[i]=i; Error 1: The size of an array is specified using square brackets [] and not parentheses (). Error : Since the array is of length 5, the indices range from 0 to 4. The loop variable i is used as an index to the array and in the given program segment, it takes values from 0 to 5. a[4] would result in an ArrayIndexOutOfBoundsException. Therefore, the loop condition should be changed to i<=4. The given program segment creates an array of size 5 and stores numbers from 0 to 4 in the array. Question. (a) Operators with higher precedence are evaluated before operators with relatively lower precedence. Arrange the operators given below in order of higher precedence to lower precedence. [] (i) && (ii) % (iii) >= (iv) ++ ++, %, >=, &&

of 10 05-11-015 16:1 (b) Identify the statements listed below as assignment, increment, method invocation or object creation statements. [] (i) System.out.println( Java ); (ii) costprice = 457.50; (iii) Car hybrid = new Car(); (iv) petrolprice++; (i) Method Invocation println() is a method of System.out. (ii) Assignment The value 457.70 is being assigned to the variable costprice. (iii) Object Creation An object of type Car is created and stored in the variable hybrid. (iv) Increment The variable petrolprice is incremented. (c) Give two differences between switch statement and if-else statement. [] (i) Switch statement can be used to test only for equality of a particular variable with a given set of values while an if-else statement can be used for testing arbitrary boolean expressions. (ii) If else can handle only primitive types and String while if-else can handle all data types. (d) What is an infinite loop? Write an infinite loop statement. [] An infinite loop is a loop whose body executes continuously. Infinite Loop using while: 1 while(true) { } Infinite Loop using for 1 for( ; ;){ } Infinite loop using do-while 1 do { } while(true); (e) What is a constructor? When is it invoked? [] A constructor is a member function of a class used to perform initialization of the object. It is invoked during object creation. Question 3. (a) List the variables from those given below that are composite data types. [] (i) static int x; (ii) arr[i] = 10; (iii) obj.display(); (iv) boolean b; (v) private char chr; (vi) String str; The primitive data types in Java are byte, short, int, long, float, double, boolean and char. All other data types arrays, objects and interfaces are composite data types. (i) x is of a primitive data type (ii) arr is variable of a composite data type of type int. i can be a variable of a primitive data type (byte, short or int) or of a composite data type (Byte, Short, Integer) (iii) obj is a variable of a composite data type (iv) b is a variable of a primitive data type (v) chr is a variable of a primitive data type (vi) str is a variable of a composite data type String which is of class type (b) State the output of the following program segment: [] 1 String str1 = "great"; String str = "minds"; System.out.println(strl.substring(0,).concat(str.substring(l))); 3 System.out.println(("WH" + (strl.substring().touppercase()))); Output is 1 grinds WHEAT Explanation for first print statement:

3 of 10 05-11-015 16:1 strl.substring(0,) gives gr str.substring(l) inds The two on concatenation gives grinds Explanation for second print statement strl.substring() gives eat eat on conversion to upper case using the function touppercase() results in EAT WH on concatenation with EAT using + gives WHEAT (c) What are the final values stored in variables x and y below? [] 1 double a = - 6.35; double b = 14.74; 3 double x = Math.abs(Math.ceil(a)); 4 double y = Math.rint(Math.max(a,b)); Math.ceil() gives the smallest of all those integers that are greater than the input. So, Math.ceil(-6.35) gives -6.0 (not -6 as ceil returns a double value). Math.abs() gives the absolute value of the number i.e. removes negative sign, if present. So, Math.abs(-6.0) results in 6.0. So, x will be 6.0. Math.max(-6.35, 14.74) returns 14.74. rint() returns the double value which is closest in value to the argument passed and is equal to an integer. So, Math.rint(14.74) returns 15.0. So, y will hold 15.0. (d) Rewrite the following program segment using the if-else statements instead of the ternary operator. [] 1 String grade = (mark >= 90)? "A" : (mark >= 80)? "B" : "C"; 1 String grade; if(marks >= 90) { 3 grade = "A"; 4 } else if( marks >= 80 ) { 5 grade = "B"; 6 } else { 7 grade = "C"; 8 } (e) Give output of the following method: [] 1 public static void main(string[] args) { int a = 5; 3 a++; 4 System.out.println(a); 5 a -= (a--) - (--a); 6 System.out.println(a); } a++ increments a from 5 to 6. The first print statement prints the value of a which is 6. a -= (a ) ( a); is equivalent to a = a ( (a ) ( a) ) a = 6 ( 6 4 ) a = 6 a = 4 1 6 4 (f) What is the data type returned by the library functions: [] (i) compareto() (ii) equals() (i) int (ii) boolean (g) State the value of characteristic and mantissa when the following code is executed. [] 1 String s = "4.3756"; int n = s.indexof('.'); 3 int characteristic = Integer.parseInt(s.substring(0,n)); 4 int mantissa = Integer.valueOf(s.substring(n+1));

4 of 10 05-11-015 16:1 n = 1 characteristic = Integer.parseInt(s.substring(0,n)) = Integer.parseInt( 4.3756.substring(0,1)) = Integer.parseInt( 4 ) = 4 characteristic = 4 mantissa = Integer.valueOf( 4.3756.substring(1+1)) = Integer.valueOf( 3756 ) = 3756 mantissa = 3756 (h) Study the method and answer the given questions. [] 1 public void samplemethod() { for( int i=0; i<3; i++ ) 3 { for( int j=0; j<; j++) 4 { int number = (int)(math.random() * 10); 5 System.out.println(number); } } } (i) How many times does the loop execute? (ii) What is the range of possible values stored in the variable number? (i) The outer loop executes 3 times ( i= 0, 1, ) and for each execution of the outer loop, the inner loop executes two times ( j= 0, 1). So, the inner loop executes 3 * = 6 times (ii) Math.random() returns a value between 0 (inclusive) and 1 (exclusive). Math.random() * 10 will be in the range 0 (inclusive) and 10 (exclusive) (int)(math.random() * 10) will be in the range 0 (inclusive) and 9 (inclusive) (only integer values) (i) Consider the following class: [] (i) Name the variables for which each object of the class will have its own distinct copy. (ii) Name the variables that are common to all objects of the class. For static variables, all objects share a common copy while for non static variable, each object gets its own copy. Therefore, the answer is (i) a, b (ii) x, y 1 public class myclass { public static int x = 3, y = 4; 3 public int a =, b = 3; } (j) What will be the output when the following code segments are executed? [] (i) (ii) 1 String s = "1001"; int x = Integer.valueOf(s); 3 double y = Double.valueOf(s); 4 System.out.println("x=" +x); 5 System.out.println("y=" +y); 1 System.out.println("The King said \"Begin at the beginning!\" to me."); (i) s = 1001 x = 1001 y = 1001.0 Output will be 1 x=1001 y=1001.0 (ii) The King said Begin at the beginning! to me. \ is an escape sequence which prints SECTION B (60 Marks) Attempt any four questions from this Section. Question 4. Define a class named moviemagic with the following description: Instance variables/data members: int year to store the year of release of a movie String title to store the title of the movie. float rating to store the popularity rating of the movie. (minimum rating = 0.0 and maximum rating = 5.0)

5 of 10 05-11-015 16:1 Member Methods: (i) moviemagic() Default constructor to initialize numeric data members to 0 and String data member to. (ii) void accept() To input and store year, title and rating. (iii) void display() To display the title of a movie and a message based on the rating as per the table below. RATING MESSAGE TO BE DISPLAYED 0.0 to.0 Flop.1 to 3.4 Semi-hit 3.5 to 4.5 Hit 4.6 to 5.0 Super Hit Write a main method to create an object of the class and call the above member methods. Program 1 import java.util.scanner; 3 public class moviemagic { 4 5 int year; 6 String title; 7 float rating; 8 9 public moviemagic() { 10 year = 0; 11 title = ""; 1 rating = 0; 13 } 14 15 public void accept() { 16 Scanner scanner = new Scanner(System.in); 17 System.out.print("Enter title: "); 18 title = scanner.nextline(); 19 System.out.print("Enter year: "); 0 year = scanner.nextint(); 1 System.out.print("Enter rating: "); rating = scanner.nextfloat(); 3 } 4 5 public void display() { 6 System.out.println("Movie Title - " + title); 7 if (rating >= 0 && rating <=.0) { 8 System.out.println("Flop"); 9 } else if (rating >=.1 && rating <= 3.4) { 30 System.out.println("Semi-hit"); 31 } else if (rating >= 3.5 && rating <= 4.5) { 3 System.out.println("Hit"); 33 } else if (rating >= 4.6 && rating <= 5.0) { 34 System.out.println("Super Hit"); 35 } 36 } 37 38 public static void main(string[] args) { 39 moviemagic movie = new moviemagic(); 40 movie.accept(); 41 movie.display(); 4 } 43 44 } Sample Output 1 Enter title: Raja Rani Enter year: 01 3 Enter rating: 5.0 4 Movie Title - Raja Rani 5 Super Hit Question 5. A special two-digit number is such that when the sum of its digits is added to the product of its digits, the result is equal to the original two-digit number. Example: Consider the number 59. Sum of digits = 5 + 9 = 14 Product of its digits = 5 x 9 = 45

6 of 10 05-11-015 16:1 Sum of the sum of digits and product of digits= 14 + 45 = 59 Write a program to accept a two-digit number. Add the sum of its digits to the product of its digits. If the value is equal to the number input, output the message Special -digit number otherwise, output the message Not a Special -digit number. We create a Scanner object and accept the input number using nextint() method. The input is stored in the variable number. It is given in the question that the input will be a two digit number. We need to extract the two digits of the number into two variables leftdigit and rightdigit. The left digit can be extracted by dividing the number by 10. (Note that number is an int and the divisor 10 is an int. So, the result will be an int and not a float i.e. we obtain only the quotient as the result). The right digit can be obtained by calculating the remainder when number is divided by 10. Let us take an example input number = 59. Then, leftdigit = number / 10 = 59 / 10 = 5 rightdigit = number % 10 = 59 % 10 = 9 Once, we have the two numbers, calculating the sum and product of the digits is easy. 1 int sumofdigits = rightdigit + leftdigit; int productofdigits = rightdigit * leftdigit; Next, we add the two variables above and store it in a new variable. 1 int sumofproductandsum = sumofdigits + productofdigits; Finally, we use if else decision statements to check if the sum of product of digits and sum of digits is same as the input number and print an appropriate message. Program 1 import java.util.scanner; 3 public class SpecialNumber { 4 5 public static void main(string[] args) { 6 Scanner scanner = new Scanner(System.in); 7 System.out.print("Enter number: "); 8 int number = scanner.nextint(); 9 int rightdigit = number % 10; 10 int leftdigit = number / 10; 11 int sumofdigits = rightdigit + leftdigit; 1 int productofdigits = rightdigit * leftdigit; 13 int sumofproductandsum = sumofdigits + productofdigits; 14 if (sumofproductandsum == number) { 15 System.out.println("Special -digit number"); 16 } else { 17 System.out.println("Not a Special -digit number"); 18 } 19 } 0 } Sample Outputs 1 Enter number: 59 Special -digit number 1 Enter number: 34 Not a Special -digit number Question 6. Write a program to assign a full path and file name as given below. Using library functions, extract and output the file path, file name and file extension separately as shown. Input C:\Users\admin\Pictures\flower.jpg Output Path: C:\Users\admin\Pictures\ File name: flower Extension: jpg We need to use the methods of the String class like indexof(), lastindexof() and substring() to solve this problem. The input String can be divided into three parts, the path, file name and extension. These three parts are separated by a backslash character and a dot as shown in the figure below.

7 of 10 05-11-015 16:1 So, first we need to find the indices of the backslash character and dot which separate these regions. Note that there are several backslash characters in the input but the backslash character which separates the file path from the name is the last backslash character in the String. So, we need to use the lastindexof() method to find the index of this backslash character. Even though in the example input, there is only one dot, folder names and file names can contain multiple dots. So, for finding the index of the dot which separates the file name and extension also, we use lastindexof() method. Moreover, the backslash character is written as \\ and not \ as \ is an escape character. 1 int indexoflastbackslash = input.lastindexof('\\'); int indexofdot = input.lastindexof('.'); Once, we have the indices of the backslash character and dot, we can use the substring method to extract the three parts. Substring() method takes two integer arguments begin and end; and returns the substring formed by the characters between begin (inclusive) and end (exclusive). 1 String outputpath = input.substring(0, indexoflastbackslash + 1); String filename = input.substring(indexoflastbackslash + 1, indexofdot); 3 String extension = input.substring(indexofdot + 1); Program 1 import java.util.scanner; 3 public class FileName { 4 5 public static void main(string[] args) { 6 Scanner scanner = new Scanner(System.in); 7 System.out.print("Enter file name and path: "); 8 String input = scanner.nextline(); 9 int indexoflastbackslash = input.lastindexof('\\'); 10 int indexofdot = input.lastindexof('.'); 11 String outputpath = input.substring(0, indexoflastbackslash + 1); 1 String filename = input.substring(indexoflastbackslash + 1, indexofdot); 13 String extension = input.substring(indexofdot + 1); 14 System.out.println("Path: " + outputpath); 15 System.out.println("File Name: " + filename); 16 System.out.println("Extension: " + extension); 17 } 18 } Sample Output 1 Enter file name and path: C:\Users\admin\Pictures\flower.jpg Path: C:\Users\admin\Pictures\ 3 File Name: flower 4 Extension: jpg Question 7. Design a class to overload a function area() as follows: (i) double area(double a. double b, double e) with three double arguments, returns the area of a scalene triangle using the formula: where (ii) double area(int a, int b, int height) with three integer arguments, returns the area of a trapezium using the formula: (iii) double area(double diagonal1, double diagonal) with two double arguments, returns the area of a rhombus using the formula: 1 public class Area { 3 public double area(double a, double b, double c) { 4 double s = (a + b + c) / ; 5 double area = Math.sqrt(s * (s - a) * (s - b) * (s - c)); 6 return area; 7 } 8

8 of 10 05-11-015 16:1 9 public double area(int a, int b, int height) { 10 double area = 0.5 * height * (a + b); 11 return area; 1 } 13 14 public double area(double diagonal1, double diagonal) { 15 double area = 0.5 * (diagonal1 * diagonal); 16 return area; 17 } 18 } Question 8. Using the switch statement. write a menu driven program to calculate the maturity amount of a Bank Deposit. The user is given the following options: (i) Term Deposit (ii) Recurring Deposit For option (i) accept principal(p), rare of interest(r) and time period in years(n). Calculate and output the maturity amount(a) receivable using the formula For option (ii) accept Monthly Installment (P), rate of interest(r) and time period in months (n). Calculate and output the maturity amount(a) receivable using the formula For an incorrect option, an appropriate error message should be displayed. 1 import java.util.scanner; 3 public class Interest { 4 5 public static void main(string[] args) { 6 Scanner scanner = new Scanner(System.in); 7 System.out.println("Menu"); 8 System.out.println("1. Term Deposit"); 9 System.out.println(". Recurring Deposit"); 10 System.out.print("Enter your choice: "); 11 int choice = scanner.nextint(); 1 switch (choice) { 13 case 1: 14 System.out.print("Enter principal: "); 15 int P1 = scanner.nextint(); 16 System.out.print("Enter rate of interest: "); 17 int r1 = scanner.nextint(); 18 System.out.print("Enter period in years: "); 19 int n1 = scanner.nextint(); 0 double maturityamount1 = P1 * Math.pow(1 + r1 / 100.0, n1); 1 System.out.println("Maturity Amount is " + maturityamount1); break; 3 case : 4 System.out.print("Enter monthly installment: "); 5 int P = scanner.nextint(); 6 System.out.print("Enter rate of interest: "); 7 int r = scanner.nextint(); 8 System.out.print("Enter period in months: "); 9 int n = scanner.nextint(); 30 double maturityamount = P * n + P * (n * (n + 1) /.0) * (r / 100.0) * (1.0 / 1); 31 System.out.println("Maturity Amount is " + maturityamount); 3 break; 33 default: 34 System.out.println("Invalid choice"); 35 } 36 } 37 } Sample Outputs 1 Menu 1. Term Deposit 3. Recurring Deposit 4 Enter your choice: 1 5 Enter principal: 1500 6 Enter rate of interest: 3 7 Enter period in years: 5 8 Maturity Amount is 1738.9111114500001 1 Menu 1. Term Deposit 3. Recurring Deposit

9 of 10 05-11-015 16:1 4 Enter your choice: 5 Enter monthly installment: 300 6 Enter rate of interest: 1 7 Enter period in months: 4 8 Maturity Amount is 775.0 1 Menu 1. Term Deposit 3. Recurring Deposit 4 Enter your choice: 3 5 Invalid choice Question 9. 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. (198, 1987, 1993. 1996, 1999, 003, 006, 007, 009, 010) 1 import java.util.scanner; 3 public class Search { 4 5 public static void main(string[] args) { 6 Scanner scanner = new Scanner(System.in); 7 System.out.print("Enter year of graduation: "); 8 int graduationyear = scanner.nextint(); 9 int[] years = {198, 1987, 1993, 1996, 1999, 003, 006, 007, 009, 010}; 10 boolean found = false; 11 int left = 0; 1 int right = years.length - 1; 13 while (left <= right) { 14 int middle = (left + right) / ; 15 if (years[middle] == graduationyear) { 16 found = true; 17 break; 18 } else if (years[middle] < graduationyear) { 19 left = middle + 1; 0 } else { 1 right = middle - 1; } 3 } 4 if (found) { 5 System.out.println("Record exists"); 6 } else { 7 System.out.println("Record does not exist"); 8 } 9 } 30 } Sample Outputs 1 Enter year of graduation: 007 Record exists 1 Enter year of graduation: 1900 Record does not exist One thought on ICSE Class 10 Computer Applications ( Java ) 014 Solved Question Paper ajay March 7, 015 at 11:1 am how to calculate RATE OF INTEREST of recurring deposit. Suppose I m investing 500 per month in recurring deposit account for years with rate of interest 8% compounded quarterly. Now I have to find out MATURITY AMOUNT. For this i will use formula : ACTUAL AMOUNT (MATURITY AMOUNT) = PRINCIPLE AMOUNT *( (1+RATE/100/4)^(4*)-1)/(1-(1+RATE/100/4)^(-1/3)) ACTUAL AMOUNT (MATURITY AMOUNT) = PRINCIPLE AMOUNT *( (1+8/100/4)^(4*)-1)/(1-(1+8/100/4)^(-1/3))

10 of 10 05-11-015 16:1 ACTUAL AMOUNT (MATURITY AMOUNT) = 659/- ======================== Now I want to know the FORMULA OF HOW TO CALCULATE RATE OF INTEREST. Suppose I m investing 500 per month in recurring deposit account interest compounded quarterly. My MATURITY AMOUNT IS 659/-. But i don t know what INTEREST RATE I HAVE GOT. I want to find out INTEREST RATE. WHAT FORMULA SHOULD I USE TO FIND OUT RATE OF INTEREST PLEASE REPLY. (C) ICSE Java, All Rights Reserved