Posts

Showing posts from May, 2022

Octal Matrix ISC Computer Science 2020 Practical

Write a program to declare a matrix A[][] of order (M ✕ N) where 'M' is the number of rows and 'N' is the number of columns such that the value of 'M' must be greater than 0 and less than 10 and the value of 'N' must be greater than 2 and less than 6. Allow the user to input digits (0 - 7) only at each location, such that each row represents an octal number. Example: 2 3 1 (decimal equivalent of 1 st row = 153 i.e. 2  ✕ 8 2 + 3  ✕ 8 1 + 1  ✕ 8 0 ) 4 0 5 (decimal equivalent of 2 nd row = 261 i.e. 4  ✕ 8 2 + 0  ✕ 8 1 + 5  ✕ 8 0 ) 1 5 6 (decimal equivalent of 3 rd row = 110 i.e. 1  ✕ 8 2 + 5  ✕ 8 1 + 6  ✕ 8 0 ) Perform the following tasks on the matrix: (a) Display the original matrix (b) Calculate the decimal equivalent for each row and display as per the format given below. Test your program for the following data and some random data: Example 1 : INPUT: M = 1 N = 3 ENTER ELEMENTS FOR ROW 1: 1 4 4 OUTPUT: FILLED MATRIX 1 4 4 DECIMAL EQUIVALENT 10

Mix Words ISC Computer Science 2020 Theory

A class Mix has been defined to mix two words, character by character, in the following manner: The first character of the first word is followed by the first character of the second word and so on. If the words are of different length, the remaining characters of the longer word are put at the end. Example : If the first word in "JUMP" and the second word is "STROLL", then the required word will be "JSUTMRPOLL". Some of the members of the class are given below: Class name : Mix Data members/instance variables : wrd: to store a word len: to store the length of the word Member functions/methods : Mix(): default constructor to initialize the data members with legal initial values void feedWord(): to accept the word in uppercase void mixWord(Mix p, Mix q): mixes the words of objects p and q as stated above and stores the resultant word in the current object void display(): displays the word Specify the class Mix giving details of the constructor, void feedWo

Binary Search ISC Computer Science 2020 Theory

Design a class BinSearch to search for a particular value in an array. Some of the members of the class are given below: Class name : BinSearch Data members/instance variables : arr[]: to store integer elements n: integer to store the size of the array Member functions/methods : BinSearch(int num): parameterized constructor to initialize n = num void fillArray(): to enter elements in the array void sort(): sorts the array elements in ascending order using any standard sorting technique int binSearch(int l, int u, int v): searches for the value 'v' using binary search and recursive technique and returns its location if found otherwise returns -1. Define the class BinSearch giving details of the constructor, void fillArray(), void sort(), and binSearch(int, int, int). Define the main() function to create an object and call the functions accordingly to enable the task. import java.util.Scanner; class BinSearch{     int arr[];     int n;     public BinSearch(int num){         n

Date Program ISC Computer Science 2020 Theory

Design a class Convert to find the date and the month from a given day number for a particular year. Example: If day number is 64 and the year is 2020, then the corresponding date would be: March 4, 2020 i.e. (31 + 29 + 4 = 64) Some of the members of the class are given below: Class name : Convert Data members/instance variables : n: integer to store the day number d: integer to store the day of the month (date) m: integer to store the month y: integer to store the year Methods/Member functions : Convert(): constructor to initialize the data members with legal initial values void accept(): to accept the day number and the year void dayToDate(): converts the day number to its corresponding date for a particular year and stores the date in 'd' and the month in 'm' void display(): displays the month name, date and year Specify the class Convert giving details of the constructor, void accept(), void dayToDate() and void display(). Define a main() function to create an ob

Strontio Number in Java

Strontio numbers are the four-digit numbers which when multiplied by 2 gives the same digit at the hundreds and tens place. Example : 1386 is a strontio number because 1386 × 2 = 2772. We observe that we have the same digit at tens and hundreds place. 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 1001, 2002, 3003, etc. are some more examples of strontio numbers. Write a program in Java to input a four-digit integer and check whether it is a strontio number or not. import java.util.Scanner; class Strontio{     public static void main(String[] args) {         Scanner in = new Scanner(System.in);         System.out.print("Enter the number: ");         int n = Integer.parseInt(in.nextLine());         if(n < 1000 || n > 9999){             System.out.println("Not a strontio number.");             return;         }         int p = n * 2;         String s = String.valueOf(p);         int len = s.length();         if(s.charAt(len - 2) == s.charAt(len - 3))  

Bouncy Number in Java

A number is said to be a Bouncy number if the digits of the number are unsorted. For example: 1728 is a bouncy number because the digits are unsorted. 2289 is not a bouncy number because the digits are sorted in ascending order. 74410 is not a bouncy number because the digits are sorted in descending order. All numbers below 100 are not bouncy numbers. Write a program in Java to accept a number and check whether it is a bouncy number or not. import java.util.Scanner; class Bouncy{     public static void main(String[] args) {         Scanner in = new Scanner(System.in);         System.out.print("N = ");         int n = Integer.parseInt(in.nextLine());         int len = String.valueOf(n).length();         int a[] = new int[len];         int j = 0;         for(int i = n; i != 0; i /= 10)             a[j++] = i % 10;         boolean asc = true;         for(int i = 0; i < a.length - 1; i++){             if(a[i] > a[i + 1]){                 asc = false;                 brea

Class 5 Types of Software

 A Fill in the blanks with the correct words. 1. Windows 10 operating system falls under the category of system software. 2. Language translator program converts the computer language to machine language. 3. OSS is a program used by the communication service provider. 4. A program that detects and remove the malicious programs from the computer is called the antivirus software. 5. WinZip is an example of a compression program. B Write T for the true statement and F for the false one. 1. When you buy a printer, you will get a software called system software. T 2. Word 2013 is application software. T 3. Backup of files is required in case original file is lost. T 4. You should run a program of Scanning and Defragmentation in order to increase the speed of a computer. T 5. In school, printing of your marksheet is a general purpose application software. F C Choose the correct option. 1. Which utility program is used in case an original file is lost or destroyed? a. Defragmentation b.

Class 8 Spreadsheet - Formulas and Functions

A Fill in the blanks with the correct words: 1. The formula in Excel starts by typing = sign. 2. The $ symbol is used for absolute referencing. 3. On selection, the formula entered into a cell is displayed in the Formula bar. 4. The : symbol is used in specifying a range of cells. 5. SUM is the name of a Function in Excel 2013. B Write T for the true statement and F for the false one. Correct the false statement(s). 1. The default cell referencing is absolute type. F (The default cell referencing is relative type) 2. The AVG function is used to find the average value of list of values. F (The AVERAGE function is used to find the average value of list of values) 3. The range A2:F5 covers 14 cells. F (The range A2:F5 covers 24 cells) 4. A function can be used inside another function. T 5. $A5 is not a valid cell reference in Excel 2013. F ($A5 is a valid cell reference in Excel 2013) C Choose the correct option. 1. Which one is not a type of cell referencing in Excel 2013? a. Relati

ICSE Computer Applications 2022 Semester 2 Examination

SEMESTER 2 EXAMINATION COMPUTER APPLICATIONS Maximum Marks: 50 Time Allowed: One and a half hours Answers to this paper must be written on the paper provided separately. You will not be allowed to write during the first 10 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. Attempt all questions from Section A and any four questions from Section B. The marks intended for questions are given in brackets [ ]. SECTION A (Attempt all questions) Question 1 [10] Choose the correct answers to the questions from the given options. (Do not copy the question. Write the correct answer only) (i) Return data type of isLetter(char) is ________. (a) Boolean (b) boolean (c) bool (d) char (ii) Method that converts a character to uppercase is ________. (a) toUpper() (b) ToUpperCase() (c) toUppercase() (d) toUpperCase(char) (iii) Give the output of the following String methods: "SUCESS".indexOf(&#

File Handling in Python

Data Files There are two types of data files: 1. Text file: Stores data in ASCII or Unicode encoding. Each line ends with a special EOL (End Of Line) character. 2. Binary file: Stores data in the same format without encoding. The lines of data are not delimited with any EOL character. Opening Files The open() function is used to open a file. By default, the file is opened in "read" mode. myfile = open("details.txt") However, you can also mention the "read" mode while opening a file. myfile = open("details.txt", "r") In the above code, "myfile" is the file object or file handle. To open a file from a specific location: myfile = open("c:\\Users\\details.txt", "r") Double backslashes are provided because it is an escape sequence for representing a single backslash. If you want to use single backslash, then use a raw string. myfile = open(r"c:\users\details.txt", "r") When the path of the fi

ICSE Computer Applications 2009

Image
  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 (a) Why is a class called a factory of objects? A class is called a factory of objects because from one class, we can create several objects of similar type. (b) State the difference between a boolean literal and a character literal. A boolean literal occupies 1 byte of memory and can be either true or false. A character literal occupies 2 bytes of memory and can be any character. (c) What is the use and syntax of a ternary operator? The ternary operator is used as

ICSE Computer Applications 2008

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 on 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 [ ]. SECTION A (40 Marks) Attempt all questions. Question 1 [10] (a) Mention any two attributes required for class declaration. Access specifier and class name. (b) State the difference between token and identifier. A token is the building block of a Java program. An identifier is a variable that is used to store values in our Java program. (c) Explain instance variable. Give an example. An instance variable is one that becomes a separate copy for each object of a given class. Examp