Computer Class X Ut
Computer Class X Ut
Class X (2023-24)
(Unit Test)
Question 1
An electronics shop has announced a special discount on the purchase of Laptops as given
below:
Category Discount on Laptop
Up to ₹25,000 5.0%
₹25,001 - ₹50,000 7.5%
₹50,001 - ₹1,00,000 10.0%
Define a class More than ₹1,00,000 15.0%
Laptop described as follows:
Data members/instance variables:
1. name
2. price
3. dis
4. amt
Member Methods:
Question 2
1. int num
2. int f
3. int rev
Member Methods:
Question 4
Define a class called Student to check whether a student is eligible for taking admission in class
XI with the following specifications:
Question 5
Question 6
Write a class with the name Area using function overloading that computes the area of a
parallelogram, a rhombus and a trapezium.
Formula:
Question 7
Write a class with the name Perimeter using function overloading that computes the perimeter
of a square, a rectangle and a circle.
Formula:
Perimeter of a square = 4 * s
Perimeter of a rectangle = 2 * (l + b)
Perimeter of a circle = 2 * (22/7) * r
Question 8
1. void calculate(int m, char ch) with one integer argument and one character argument. It checks
whether the integer argument is divisible by 7 or not, if ch is 's', otherwise, it checks whether the
last digit of the integer argument is 7 or not.
2. void calculate(int a, int b, char ch) with two integer arguments and one character argument. It
displays the greater of integer arguments if ch is 'g' otherwise, it displays the smaller of integer
arguments.
Question 9
1. void compare(int, int) — to compare two integers values and print the greater of the two
integers.
2. void compare(char, char) — to compare the numeric value of two characters and print
with the higher numeric value.
3. void compare(String, String) — to compare the length of the two strings and print the
longer of the two.
Question 10
------------