0% found this document useful (0 votes)
16 views3 pages

Assignment For First Term - Grade 10

The document outlines a programming assignment for Grade 10 Computer Applications at Stanes School, focusing on class design and function overloading in Java. It includes tasks such as creating classes for printing patterns, managing book details with discounts, checking characters, identifying Armstrong numbers, calculating loan interest, and generating tech numbers. Each task requires the implementation of specific methods and a main method to demonstrate functionality.

Uploaded by

jspritika
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)
16 views3 pages

Assignment For First Term - Grade 10

The document outlines a programming assignment for Grade 10 Computer Applications at Stanes School, focusing on class design and function overloading in Java. It includes tasks such as creating classes for printing patterns, managing book details with discounts, checking characters, identifying Armstrong numbers, calculating loan interest, and generating tech numbers. Each task requires the implementation of specific methods and a main method to demonstrate functionality.

Uploaded by

jspritika
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/ 3

Stanes School – ICSE/ISC

Grade 10 Computer Applications


Programming Assignment
1. Design a class to overload a function print( ) as follows:
(i) void print(int a, int n)- to print the following pattern
1010
1010

(ii) void print( char c1, int m ) –to print the following pattern
example: if the arguments given are @ and 5
@
@@
@@@
@@@@
@@@@@
(iii) void print( ) – to print the following pattern

q r s t
uvw
xy
z
Write the main method to create an object and invoke the above methods.
2. Define a class named BookFair with the following description:
Instance variables/Data members:
String Bname – stores the name of the book.
double price – stores the price of the book.
Member Methods:
(i) BookFair() – Default constructor to initialize data members.
(ii) void Input() – To input and store the name and the price of the book.
(iii) void calculate() – To calculate the price after discount. Discount is calculated based on
the following criteria.
PRICE DISCOUNT
Less than or equal to Rs 1000 2% of price
More than Rs 1000 and less than
or equal to Rs 3000 10% of price
More than Rs 3000 15% of price
(iv) void display() – To display the name and price of the book after discount.
Write a main method to create an object of the class and call the above member methods.
3. Define a class to overload a function find() as follows
void find(char a): to check whether the entered character is an alphabet if so check its case
and convert to the opposite case otherwise display the ASCII value of the character entered.
void find(char m, char n) : to check the numeric values of both the characters and
print the character with greatest numeric value.
void find(int a, int b, char ch) : to print the cube root of sum of a and b if ch is ‘3’
otherwise print the value of a if the value of ch is ‘P’
b

Write a main method, create object and call the above functions
4. An Armstrong number is the sum of the cubes of the digits of the number results in the
number itself.
Eg: 153= 13+53+33=153
Design a class Armstrong with the following description
Class name : Armstrong
Data Member/Instance Variables
n : integer to store the number
Sum : stores the sum of the cubes of the digits of the number .
Member methods/Functions
Armstrong(): default constructor
void get(): to input the value of n from the user
void socd(): to find the sum of the cubes of the digits of n and store it in sum
void isArm(): to check and display whether the entered number is an Armstrong number or
not with proper messages.
Write a main method, create object and call the above mentioned functions.
5. Syndicate Bank charges interest for the vehicle loan as per the following tariff.
Number of years Rate of interest
Up to 5 years 15%
More than 5 and up to 10 years 12%
Above 10 years 10%
Design a class Loan with the following specifications
Class name : Loan
Data members/Instance members
time : time for which loan is sanctioned
principle: amount sanctioned
rate: rate of interest
intr: to store the interest
amt: amount to pay after given time
Member Methods:
Loan() : default constructor
void getLoan(): to accept principle and time
void calLoan(): to find interest by applying the above criteria using the formula
interest=principle*rate*time/100 and also calculate the amount using the formula
amount = principle+interest
void display(): to display the simple interest and amount
Write a main method, create object call the above
6. A tech number has even number of digits. If the number is split in two equal halves, then
the square of sum of these halves is equal to the number itself. Write a program to generate
and print all four digits tech numbers.
Example:
Consider the number 3025 Square of sum of the halves of 3025 = (30 + 25)2
= (55)2= 3025 is a tech number.

You might also like