0% found this document useful (0 votes)
70 views4 pages

Computer Class X Ut

This document contains 10 questions for a computer application assignment. Each question asks students to define a class with specified data members and member methods. The questions cover topics like discounts, prime numbers, population growth, student eligibility, salaries, area and perimeter calculations, and overloading functions. Students are instructed to write the code for each class, compile and test their programs, and submit their work in a Word document with formatting guidelines.

Uploaded by

haimandas9881
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views4 pages

Computer Class X Ut

This document contains 10 questions for a computer application assignment. Each question asks students to define a class with specified data members and member methods. The questions cover topics like discounts, prime numbers, population growth, student eligibility, salaries, area and perimeter calculations, and overloading functions. Students are instructed to write the code for each class, compile and test their programs, and submit their work in a Word document with formatting guidelines.

Uploaded by

haimandas9881
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Computer Application Assignment

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:

1. A parameterised constructor to initialize the data members


2. To accept the details (name of the customer and the price)
3. To compute the discount
4. To display the name, discount and amount to be paid after discount.
Write a main method to create an object of the class and call the member methods.

Question 2

Write a program by using a class with the following specifications:


Class name — Calculate
Instance variables:

1. int num
2. int f
3. int rev
Member Methods:

1. Calculate(int n) — to initialize num with n, f and rev with 0 (zero)


2. int prime() — to return 1, if number is prime
3. int reverse() — to return reverse of the number
4. void display() — to check and print whether the number is a prime palindrome or not
Question 3

The population of a country in a particular year can be calculated by:


p*(1+r/100) at the end of year 2000, where p is the initial population and r is the
growth rate.
Write a program by using a class to find the population of the country at the end of each year
from 2001 to 2007. The Class has the following specifications:

Class name — Population


Data Members — float p,r
Member Methods:

1. Population(int a,int b) — Constructor to initialize p and r with a and b respectively.


2. void print() — to calculate and print the population of each year from 2001 to 2007.

Question 4

Define a class called Student to check whether a student is eligible for taking admission in class
XI with the following specifications:

Data Members Purpose


String name to store name
int mm to store marks secured in Maths
int scm to store marks secured in Science
double comp to store marks secured in Computer
Member Methods Purpose
Student( ) parameterised constructor to initialize the data members by
accepting the details of a student
check( ) to check the eligibility for course based on the table given below
void display() to print the eligibility by using check() function in nested form
Marks Eligibility
90% or more in all
Science with Computer
the subjects
Average marks
Bio-Science
90% or more
Average marks
80% or more and Science with Hindi
less than 90%
Write the main method to create an object of the class and call all the member methods.

Question 5

Define a class salary described as below :


Data Members: Name, Address, Phone, Subject Specialisation, Monthly Salary, Income Tax.
Member methods:
(i) To accept the details of a teacher including the monthly salary.
(ii) To display the details of the teacher.
(iii) To compute the annual Income Tax as 5% of the annual salary above Rs. 1,75,000/-.
Write a main method to create object of a class and call the above member method.

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:

Area of a parallelogram (pg) = base * ht

Area of a rhombus (rh) = (1/2) * d1 * d2


(where, d1 and d2 are the diagonals)

Area of a trapezium (tr) = (1/2) * ( a + b) * h


(where a and b are the parallel sides, h is the perpendicular distance between the parallel sides)

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

Design a class overloading a function calculate() as follows:

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

Design a class to overload a function compare( ) as follows:

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

Design a class to overload a function num_calc() as follows :


(a) void num_calc (int num, char ch) with one integer argument and one character argument,
computes the square of integer argument if choice ch is ‘s’ otherwise finds its cube.
(b) void num_calc (int a, int b, char ch) with two integer arguments and one character argument.
It computes the product of integer arguments if ch is ‘p’
else adds the integers.
(c) void num_calc (String s1, String s2) with two string arguments, which prints whether the
strings are equal or not.

------------

General Instructions to Follow

 All programs should be compiled and properly executable.


 Copy the Question, Code, Variable description table and the output of
each program in a single Word file. Each question should start from a
new page.

 Put a simple border in all pages.

 Font Style will be “Times New Roman”.

 Font Size of Questions will be 12, and Code is 11.

 Page No. should be there at the bottom-middle position in the project


printed copy.

 The Cover Page will be given.

 Add the Acknowledgement after the Cover Page.

 Index Page will be given add Index after Acknowledgement.

You might also like