Posts

Hotel Customer Inheritance | ISC Computer Science 2026 Theory

A superclass Hotel has been defined to store the details of a hotel. Define a subclass Customer to calculate the total bill for a customer as per the following criteria: Room type          Additional Amount Executive            10% of room rent Suite                      20% of room rent The details of the members of both the classes are given below: Class name : Hotel Data members/instance variables : hname: to store hotel name roomrent: to store the rent per day Methods/Member functions : Hotel(...): parameterized constructor to assign values to its data members void show(): to display hotel details Class name : Customer Data members/instance variables : cname: to store customer name days: to store the number of days of stay type: to store the room type surcharge: to store the additional amount amt: to store the total amount Methods/Member functions : Customer(...): par...

ICSE Computer Applications 2026

Image
  SECTION A (40 Marks) (Attempt all questions from this section) Question 1 Choose the correct answers to the questions from the given options. (Do not copy the questions, write only the correct answers) (i) The full form of JVM is: (a) Java Visible Machine (b) Java Virtual Mode (c) Java Virtual Machine (d) Java Visible Mode (ii) Which of the following occupies 2 bytes of storage? (a) 25 (b) AM (c) 35.2 (d) \\ (iii) In a statement c = c + (x * d + e); which variable is an accumulator? (a) d (b) c (c) e (d) x (iv) Which of the following is not an access specifier? (a) private (b) protected (c) package (d) public (v) What is the output of the statement Math.pow(36, 6 / 5) ? (a) 36.0 (b) 1.0 (c) 73.71 (d) 6.0 (vi) Read the if program segment given below: if(a > b)     z = 25; else     z = 35; Which one of the following is the correct conversion of the if program segment to ternary? (a) z = a > b? 35 : 25; (b) z = a > b? 25 : 35; (c) z = a > b: 35 ? 25;...

Browser Stack Program | ISC Computer Science 2026 Theory

In any internet browser, a user can visit new webpages and go back to previously visited webpages. Each new webpage URL is stored in browser's memory such that when the user clicks 'Back' button, the previous webpage gets displayed. The details of the members of the class are given below: Class name : Browser Data members/instance variables : pages[]: an array to hold the URL's of visited webpages max: to store the maximum capacity of the array top: to point to the index of the last visited webpages Methods/Member functions : Browser(int cap): constructor to assign max = cap and top = -1 void visit(String url): to add URL of a new webpage if possible, else display the message "Browser history full" String back(): to remove and return the last visited webpage URL, if present, else to return the message "No previous browser history" (i) Specify the class Browser giving details of the functions void visit(String) and String back(). Assume that the other...

Pendulum String Program | ISC Computer Science 2026 Theory

Design a class PendulumS to perform an operation on a word containing alphabets in uppercase only. Rearrange the word by putting the lowest ASCII value character at the centre and the second lowest ASCII value character to its right and the third to its left and so on. Example 1 : INPUT: COMPUTER OUTPUT: TPMCEORU Example 2 : INPUT: SCIENCE OUTPUT: SIECCEN The details of the members of the class are given below: Class name : PendulumS Data members/instance variables : wrd: to store the original word newwrd: to store the rearranged word Methods/Member functions : PendulumS(String k): parameterised constructor to initialise wrd = k and newwrd = "" int minCharIndex(String str): to find the index of the minimum ASCII value character in str and return it void arrange(): to rearrange the characters of wrd as per the given instructions and store it in newwrd by invoking minCharIndex() void display(): to display the original word and the rearranged word Specify the c...

Trimorphic Number | ISC Computer Science 2026 Theory

(i) A class Trimorphic has been defined to accept a positive integer from the user and display if it is a Trimorphic number or not. A number is said to be Trimorphic if the cube of the number ends with the number itself. Example 1: 24 3 = 13824 ends with 24 Example 2: 5 3 = 125 ends with 5 The details of the members of the class are given below: Class name : Trimorphic Data members/instance variables : n: to store the number cube: to store the cube of the number Methods/Member functions : Trimorphic(): constructor to initialise the data members with legal initial values void accept(): to accept a number boolean check(int num, long c): to compare num with the ending digits of c using recursive technique void result(): to check whether the given number is a trimorphic number by invoking the function check() and to display an appropriate message. Specify the class Trimorphic giving the details of the constructor, void accept(), boolean check() and void result(). De...

Add Two Time Periods | ISC Computer Science 2026 Theory

A class TimeOp has been defined to add any two accepted time periods. Example: Time A = 6 hours 35 minutes 40 seconds Time B = 7 hours 45 minutes 30 seconds Time A + Time B = 14 hours 21 minutes 10 seconds (where 60 minutes = 1 hour and 60 seconds = 1 minute) The details of the members of the class are given below: Class name : TimeOp Data member/instance variable : arr[]: integer array to hold three elements (hours, minutes and seconds) Methods/Member functions : TimeOp(): default constructor void readTime(): to accept the elements of the array TimeOp addTime(TimeOp tt): to add the time of the parameterised object tt and the current object, to store it in a local object and return it void dispTime(): to display the array elements in hours:minutes:seconds format Specify the class TimeOp giving the details of the constructor, void readTime(), TimeOp addTime(TimeOp) and void dispTime(). Define the main() function to create objects and call the functions accordingly to enable t...

Class 12 CBSE Computer Science 2024 Paper Solved

Image
SECTION A State True or False: While defining a function in Python, the positional parameters in the function header must always be written after the default parameters. False The SELECT statement when combined with ________ clause, returns records without repetition. a) DISTINCT b) DESCRIBE c) UNIQUE d) NULL What will be the output of the following statement? print(16 * 5 / 4 * 2 / 5 - 8) a) -3.33 b) 6.0 c) 0.0 d) -13.33 What possible output from the given options is expected to be displayed when the following Python code is executed? import random Signal = ['RED', 'YELLOW', 'GREEN'] for K in range(2, 0, -1): R = random.randrange(K) print(Signal[R], end = '#') a) YELLOW # RED # b) RED # GREEN # c) GREEN # RED # d) YELLOW # GREEN # In SQL, the aggregate function which will display the cardinality of the table is ________. a) sum() b) count(*) c) avg() d) sum(*) Which protocol out of the following is used to send and rec...