COMPUTER APPLICATIONS

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

COMPUTER APPLICATIONS

COMPUTER APPLICATIONS

COMPUTER APPLICATIONS

COMPUTER APPLICATIONS

COMPUTER APPLICATIONS

Sample Paper of Computer for Class 10

COMPUTER APPLICATIONS

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

( &% class MyClass { }

ICSE Solved Paper, 2018

Question 4- Write a program to input a word from the user and remove the duplicate characters present in it. Example:

University of Palestine. Mid Exam Total Grade: 100

BSc (Hons) Computer Science with Network Security/ BSc (Hons) Software Engineering/ BSc (Hons) Web Technologies. Examinations for 2016 Semester 1

Prof. Navrati Saxena TA: Rochak Sachan

JAVA OPERATORS GENERAL

Question: Total Points: Score:

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

ESC101 : Fundamental of Computing

Operators and Expressions

CS101 Part 2: Practice Questions Algorithms on Arrays, Classes and Objects, String Class, Stack Class

Question: Total Points: Score:

In this chapter, you will:

Java Identifiers, Data Types & Variables

Java Basic Programming Constructs

Introduction to Programming Using Java (98-388)

Java Review. Java Program Structure // comments about the class public class MyProgram { Variables

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:

LAB 11: METHODS. CPCS The Lab Note Lab 11 Page 1. Statement Purpose:

Objects and Iterators

public class Foo { private int var; public int Method1() { // var accessible anywhere here } public int MethodN() {

SAMPLESAMPLESAMPLESAMPLESAMPLESAMPLESAMPLESAMPLESAMPLESAMPLE SAMPLE CSE21

Java Notes. 10th ICSE. Saravanan Ganesh

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Use the scantron sheet to enter the answer to questions (pages 1-6)

Computer Programming, I. Laboratory Manual. Final Exam Solution

Computer Science 1 Ah

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

Chapter 3: Operators, Expressions and Type Conversion

Lecture Set 4: More About Methods and More About Operators

Introduction to Programming (Java) 4/12

Java is an objet-oriented programming language providing features that support

CS-140 Fall 2017 Test 1 Version Practice Practie for Sept. 27, Name:

COMPUTER SCIENCE. Paper 1

The Basic Parts of Java

CSE 201 JAVA PROGRAMMING I. Copyright 2016 by Smart Coding School

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:

1.00 Introduction to Computers and Engineering Problem Solving Quiz 1 March 4, 2005

Java Programming. Atul Prakash

PROGRAMMING FUNDAMENTALS

Selected Questions from by Nageshwara Rao

CS212 Midterm. 1. Read the following code fragments and answer the questions.

JAVA WRAPPER CLASSES

Exam 2. Programming I (CPCS 202) Instructor: M. G. Abbas Malik. Total Marks: 40 Obtained Marks:

Building Java Programs. Chapter 2: Primitive Data and Definite Loops

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

CS171:Introduction to Computer Science II

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

I pledge by honor that I will not discuss this exam with anyone until my instructor reviews the exam in the class.

1007 Imperative Programming Part II

Programming with Java

Java for Non Majors Spring 2018

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

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

McGill University School of Computer Science COMP-202A Introduction to Computing 1

Fall CS 101: Test 2 Name UVA ID. Grading. Page 1 / 4. Page3 / 20. Page 4 / 13. Page 5 / 10. Page 6 / 26. Page 7 / 17.

Exam 1. Programming I (CPCS 202) Instructor: M. G. Abbas Malik. Total Marks: 45 Obtained Marks:

SAMPLE QUESTIONS FOR DIPLOMA IN INFORMATION TECHNOLOGY; YEAR 1

Exercises Software Development I. 05 Conversions and Promotions; Lifetime, Scope, Shadowing. November 5th, 2014

CCHAPTER SELECTION STATEMENTS HAPTER 3. Objectives

Some Sample AP Computer Science A Questions - Solutions

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

Birkbeck (University of London) Software and Programming 1 In-class Test Mar Answer ALL Questions

CSE 142 Su 04 Computer Programming 1 - Java. Objects

Chapter 6 Primitive types

Zheng-Liang Lu Java Programming 45 / 79

Final Exam COMP Fall 2004 Dec 16, 2004

CMPT 125: Lecture 4 Conditionals and Loops

1 Short Answer (15 Points Each)

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

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

Java+- Language Reference Manual

Last Name: Circle One: OCW Non-OCW

Oracle 1Z Java SE 8 Programmer I. Download Full Version :

Getting started with Java

Building Java Programs

SECONDARY SCHOOL, L-IMRIEĦEL HALF YEARLY EXAMINATIONS 2016/2017

CS260 Intro to Java & Android 03.Java Language Basics

COMPUTER SCIENCE Paper 1

Programming Projects: 2.1, 2.3, 2.4, 2.7, 2.8, 2.13

Tools : The Java Compiler. The Java Interpreter. The Java Debugger

Chapter 3 Selection Statements

Operators Questions

Java Programming for Selenium

Good Earth School Naduveerapattu. Computer Applications Worksheet Class X

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

3. Convert 2E from hexadecimal to decimal. 4. Convert from binary to hexadecimal

Chapter 4: Control Structures I

AP Computer Science Unit 1. Programs

1 Shyam sir JAVA Notes

Transcription:

COMPUTER APPLICATIONS (Theory) (Two hours) Answers 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. The time given at the head of this Paper is the time allowed for writing the answers. This Paper is divided into two Sections. Attempt all questions from Section A and any four questions from Section B. The intended marks for questions or parts of questions are given in brackets [ ]. Question 1. SECTION A (40 Marks) Attempt all questions. (a) (b) Which of the following are valid comments? /* comment */ (ii) /* comment (iii) // comment (iv)*/ comment */ [2] What is meant by a package? Name any two Java Application Programming Interface packages. [2] (c) Name the primitive data type in Java that is: 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' [2] (d) State one difference between floating point literals float and double. [2] This Paper consists of 7 printed pages and 1 blank page. T14 861 www.javaforschool.com Turn over

(e) Find the errors in the given program segment and re-write the statements correctly to assign values to an integer array. int a = new int( 5 ); for( int i=0; i<=5; i++ ) a[i]=i; [2] Question 2. (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. && (ii) % (iii) >= (iv) ++ [2] (b) Identify the statements listed below as assignment, increment, method invocation or object creation statements. System.out.println("Java"); (ii) costprice = 457.50; (iii) Car hybrid = new Car(); (iv) petrolprice++; [2] (c) Give two differences between switch statement and if-else statement. [2] (d) What is an infinite loop? Write an infinite loop statement. [2] (e) What is a constructor? When is it invoked? [2] Question 3. (a) List the variables from those given below that are composite data types. static int x; (iv) boolean b; (ii) arr[i]=10; (v) private char chr; (iii) obj.display(); (vi) String str; [2] (b) State the output of the following program segment: String str1 = great ; String str2 = minds ; System.out.println(strl.substring(0,2).concat(str2.substring(l))); System.out.println(("WH" + (strl.substring(2).touppercase()))); [2] T14 861 2 www.javaforschool.com

(c) What are the final values stored in variables x and y below? double a = 6.35; double b = 14.74; double x = Math.abs(Math.ceil(a)); double y = Math.rint(Math.max(a,b)); [2] (d) Rewrite the following program segment using the if-else statements instead of the ternary operator. String grade = (mark>=90)? "A" : (mark>=80)? "B" : "C"; [2] (e) (f) (g) Give output of the following method: public static void main(string[] args) { int a = 5; a++; System.out.println(a); a = (a ) ( a); System.out.println(a); } [2] What is the data type returned by the library functions: compareto() (ii) equals() [2] State the value of characteristic and mantissa when the following code is executed. String s = "4.3756"; int n = s.indexof('.'); int characteristic = Integer.parseInt(s.substring(0,n)); int mantissa = Integer.valueOf(s.substring(n+1)); [2] (h) Study the method and answer the given questions. public void samplemethod() { for( int i=0; i<3; i++ ) { for( int j=0; j<2; j++) { int number = (int)(math.random() * 10); System.out.println(number); } } } How many times does the loop execute? 3 T14 861 www.javaforschool.com Turn over

(ii) What is the range of possible values stored in the variable number? [2] Consider the following class: public class myclass { public static int x = 3, y = 4; public int a = 2, b = 3; } 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. [2] (j) What will be the output when the following code segments are executed? String s = "1001"; int x = Integer.valueOf(s); double y = Double.valueOf(s); System.out.println("x=" +x); System.out.println("y=" +y); (ii) System.out.println("The King said \"Begin at the beginning!\" to me."); [2] Question 4. SECTION B (60 Marks) Attempt any four questions from this Section. The answers in this Section should consist of the Programs in either Blue J environment or any program environment with Java as the base. Each program should be written using Variable descriptions/mnemonic Codes such that the logic of the program is clearly depicted. Flow-Charts and Algorithms are not required. 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) T14 861 4 www.javaforschool.com

Member Methods: 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 2.0 Flop 2.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. [15] 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 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 2-digit number otherwise, output the message Not a Special 2-digit number. [15] 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 Output C:\Users\admin\Pictures\flower.jpg Path: C:\Users\admin\Pictures\ File name: flower Extension: jpg [15] 5 T14 861 www.javaforschool.com Turn over

Question 7. Design a class to overload a function area() as follows: double area(double a, double b, double c) with three double arguments, returns the area of a scalene triangle using the formula: area = ( )( )( ) where s = (ii) double area(int a, int b, int height) with three integer arguments, returns the area of a trapezium using the formula: area = height (a+b) (iii) double area(double diagonal1, double diagonal2) with two double arguments, returns the area of a rhombus using the formula: area = (diagonal1 diagonal2) [15] 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: (ii) Term Deposit Recurring Deposit For option accept principal(p), rate of interest(r) and time period in years(n). Calculate and output the maturity amount (A) receivable using the formula A= P1 + 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 A = P n + P () For an incorrect option, an appropriate error message should be displayed. [15] T14 861 6 www.javaforschool.com

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. {1982, 1987, 1993, 1996, 1999, 2003, 2006, 2007, 2009, 2010} [15] 7 T14 861 www.javaforschool.com www.javaforschool.com Turn over