0% found this document useful (0 votes)
0 views11 pages

Mini Grade 10 Project

The document outlines a project work for Grade 10 students at Bishop Cotton Girls' School for the academic year 2024-2025, focusing on computer applications. It includes various programming tasks such as creating classes for soft drink discounts, employee salary calculations, bank interest calculations, and method overloading for geometric area calculations. Additionally, it covers topics like constructors, searching and sorting algorithms, and operations on 2D arrays.

Uploaded by

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

Mini Grade 10 Project

The document outlines a project work for Grade 10 students at Bishop Cotton Girls' School for the academic year 2024-2025, focusing on computer applications. It includes various programming tasks such as creating classes for soft drink discounts, employee salary calculations, bank interest calculations, and method overloading for geometric area calculations. Additionally, it covers topics like constructors, searching and sorting algorithms, and operations on 2D arrays.

Uploaded by

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

BISHOP COTTON GIRLS’ SCHOOL

GRADE 10 - PROJECT WORK - 2024-’25


COMPUTER APPLICATION

Part 1:

1) A Soft drink manufacturing company offers a discount to the dealer and retailer based on
the quantity of purchase as per the following criteria.

Purchase Dealer Retailer


Upto 10 litres 10% 8%
11 litres - 20 litres 15% 10%
More than 20 litres 20% 15%

Define a class with the following specifications:


Class name: Sdrink

Variables:
********
String namCus: Name of the customer.
int qty: Quantity purchased in litre.
double price: Price of one litre of soft drink .
double amount : Total amount (qty x price)
double discount: Amount discounted.
double fAmount : Final amount after discount.
● Accept namCus,qty ,price using the methods of Scanner class.
● Calculate the amount, discount ( based on the given criteria),fAmount
● Display all the details in the below format.
namCus qty price amount discount fAmount
xxxx xxxx xxxx xxxx xxxx xxxx

Use a menu-driven approach having choices (*) for Dealer and ($) for Retailer.

Note:
1) The same program should be done using the below criteria also:
a) 1 for Dealer and 2 for Retailer.
b) Dl for Dealer and Re for Retailer.
2) Try using double variables for the above choices and find out what happens.
2) Write a Java program to input the Customer name , Customer id , purchase amount .
Calculate the discount amount , final amount and decide the gift based on the table given
below.
Purchase Amount Discount (%) Gift
Less than 10000 Nil clock
10,000 to 25,000 2 Water bottle
25,001 to 50,000 3 Watch
Above 50,000 5 Silver Tumbler
Display all the details in the below format.
Name : xxxx
Id : xxxx
Amount : xxxx
Discount : xxxx
final amount : xxxx
Gift : xxxx
2)

3)

3) Define a class with the following specifications:


Class name: employee
Member variables:
eno – employee number
ename — name of the employee
age — age of the employee
basic — basic salary
[Declare the variables using appropriate data types]

Member methods:
void accept() - accept the details using Scanner class
double calculate() - to calculate the net salary as per the given specifications and return it.

net = basic+da+hra – pf
hra = 18% of basic
da = 17.45% of basic
pf = 8.10% of basic

If the age of the employee is above 50 he/she gets an additional allowance of Rs. 5000/-
void print() - to print the details as per the given format:
Eno name age basic net
Xxx xxxx xxx xxx xxx

void main() – to create an object of the class and invoke the methods

4) Define a class with the following specifications:


Class name: Bank
Member variables:
double p – stores the principal amount
double n – stores the time period in years
double r – stores the rate of interest
double a – stores the amount
Member methods:
void accept() – input values for p and n using Scanner class methods only.

void calculate() – calculate the amount using the formula

based on the following conditions:

Time in Years Rate %

Upto 1/2 9

> 1/2 to 1 10

> 1 to 3 11
>3 12

void display() – displays the details in the given format:

Principal Time Rate Amount


xxx xxx xxx xxx

Write the main() method to create an object and call the above methods.

Part 2: Constructors:

5) Define a class with the following specifications:


Class name: School
Member variables: (Choose appropriate data type)
sName: name of the school.
year: Year in which the school was started
board: Board to which the school is affiliated.(CBSE/ICSE/STATE/IB)
Member methods:
i) void display () : To display the output.
ii) Default constructor to initialize the value of year.
iii)Parameterized constructor to set school name.
iv)Non - parameterised constructor to set the year
iv)void input ( ) - To accept the value of board.
v) void print() - To print the member variables

Write the main method to create an object and call the above methods.

5) Design a class ‘Volume’ with the below method.

Member variables:

● double height: Height of sphere


● double radius:Radius of sphere
● double volume: Volume of sphere

Part 3: Member methods:

i) Volume ()- To initialize the member variables with default values.

ii) Volume(double radi)- Paramerised constructor to initialize the value of radius.

iii) double volume(double h ) – Returns volume by accepting height ‘h’ as the arguments and using the
formula: v = 22 / 7 × r2 × h
6) An electronics shop has announced a special discount on the purchase of Laptops as
given below:

Category Discount on Laptop

p to upto ₹25,000 5.0% 5.0 %

25,0 ₹25,001 to ₹50,000 7.5% 6.0 %

50, ₹50,001 - ₹1,00,000 10.0 7.5 %

More >t han ₹1,00,000 15.0 8.5 %

Define a class Laptop described as follows:

Data members/instance variables:

1. name
2. price
3. dis
4. amt

Member Methods:

1. A constructor to initialize the data members with default values.


2. A parameterized constructor to initialize the name by accepting the details .
3. A non-parameterised constructor to initialize the price .
4. void compute() -To compute the discount
5. void display() - 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.

Part 4: Method overloading

7) Write a class with the name Area using method overloading that computes the area of a
parallelogram, a rhombus and a trapezium.

Formula:

● void Area(int b, int h)

//Area of a parallelogram (pg) = base * ht

● double Area ( double d1,double d2)


//Area of a rhombus (rh) = (1/2) * d1 * d2
(where, d1 and d2 are the diagonals)

● double Area ( int a,int b,double p)

//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)

8)

9) Design a class to overload a function check() as follows:

i) void check(String str, char ch) – to find and print the frequency of a character in a
string. Example :Input: Str = “success” ch = ‘s’ Output: number of s present is=3

ii) void check (String s1) – to display only the vowels from string s1 , after converting it
to lower case. Example :Input:S1= “computer” Output: o u e

10)
11) Design a class to overload a function compare as follows:

(a) void compare (int, int) – to compare two integer values and print the greater of the two

integers.

(b) void compare (char, char ): to compare the numeric value of two characters and print

the character with higher numeric value.

(c) void compare(String, String): to compare the length of the two strings and print the

longer of the two.

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

1. 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.
2. void num_calc( int a, int b, char ch ) with two integer argument and one character

argument. It computes the product of integer arguments if ch is ‘p’ else adds the

integers.

3. void num_calc( Sting s1, String s2) with two string arguments, which prints whether

the strings are equal or not

13)Design a class to overload a function series() as follows:

(i) double series(double n) with one double argument and returns the sum of the

series.sum = 1/1 + 1/2 + 1/3 + ..... 1/n

(ii) (ii) double series(double a, double n) with two double arguments and returns the sum

of theseries. Sum = 1/a 2 + 4/a 5 + 7/a 8 + 10/a 11 ..... to n terms

14) Design a class to overload a function check() as follows:

i) void check(String str, char ch) – to find and print the frequency of a character in a string.

Example :Input: Str = “success” ch = ‘s’

Output: number of s present is=3

ii) void check (String s1) – to display only the vowels from string s1 ,after converting it to lower case.

Example :Input:S1= “computer”

Output: o u e

15) Define a class to overload the method print() as follows:

(i) void print () to print the format


1

23

456

(ii) boolean print (int n) to check whether the number is a Dudeney number,

Hint: A number is dudeney if the cube of the sum of


the digits is equal to the number itself.

Eg: 512 = (5+1+2)3= (8)3= 512


(iii) void print (int a, char ch) if ch = s or S print the square of the number
else if ch = c or C print the cube of the number

Part 5: Searching :

16) Define a class to accept values into an array of integer data type of size 20. Accept a integer
value from user and search in the array using linear search method. If value is found display message
"Found" with its position where it is present in the array. Otherwise display message "not found".

Note: The same program should be done with

a) double array

17) Binary search for a char array of size 20

Note: The same program should be done with

a) String array

18)Write a program in JAVA that reads the following list of countries and their respective cities into
two separate one-dimensional arrays. The program should accept the name of a country as input and
give the name of the corresponding city as an output. The program should be designed to give an
error message where a city is asked for a country whose name is not given in the list. To stop the
program, "XXX" is to be entered as input.

Sorting

19) Define a class to accept 10 integer value from a user. Using bubble sort technique, arrange them
in ascending order and descending order. Display the sorted arrays and original array.

Note: The same program should be done with

b) char array

20)Define a class to accept 10 double value from a user. Using selection sort technique, arrange
them in ascending order and descending order. Display the sorted arrays and original array.

21)Create a list of names of 25 Country's and then display name alphabetically.

Part 6: 2D array

22) Two matrices are said to be equal if they have the same dimension and their corresponding
elements are equal.

For example , the two matrices A and B given below are equal:
Design a class EqMat to check if two matrices are equal or not.

Assume that the two matrices have the same dimension.

23) Define a class to accept a 2D array and perform the below actions depending upon user
choice:

1 -> Printing array elements in matrix format


2 -> Sum of array elements
3 -> Row wise traversal and
4 ->Column-wise traversal
5 -> Sum of row elements
6 -> Print diagonal elements (Left) and find its sum
7 -> Print diagonal elements (right) and find its sum
8 ->Find the min and max element in array

24) Define a class to accept values into a 3 × 3 array and check if it is a special array. An array is a
special array if the sum of the even elements = sum of the odd elements.

Example:
A[ ][ ]={{ 4 ,5, 6}, { 5 ,3, 2}, { 4, 2, 5}};
Sum of even elements = 4 + 6 + 2 + 4 + 2 = 18
Sum of odd elements = 5 + 5 + 3 + 5 = 18

25)

26)

You might also like