0% found this document useful (0 votes)
3 views

computer

The document outlines a computer project for Std 10 students at Podar International School, consisting of 20 practical assignments. Each assignment requires handwritten programs with comments and variable descriptions, covering various topics such as Niven numbers, series calculations, class definitions, and string manipulations. Students are expected to submit their work on assignment sheets.

Uploaded by

aaryansultane
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

computer

The document outlines a computer project for Std 10 students at Podar International School, consisting of 20 practical assignments. Each assignment requires handwritten programs with comments and variable descriptions, covering various topics such as Niven numbers, series calculations, class definitions, and string manipulations. Students are expected to submit their work on assignment sheets.

Uploaded by

aaryansultane
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Podar International School(ISC), Pimpri.

Std 10 – Computer Project


20 Practical Assignments

Note : Handwritten program with minimum 2 comments and variable


description table for each question, should be submitted . Write programs on
assignment sheet only.

1 . Write a program to input an integer and pass it as parameter to a function


Niven() to check whether it is Niven number or not. A number is said to be Niven if
it is divisible by the sum of the digits of that number, example 126 and 1729.

2 Write a menu driven program using 2 functions to perform the following:


(a) Series 1 - To find the sum of the series given below i.e
1+3+5+7+9+…………….99.
(b) Series 2- to calculate the sum of the following series.
S = 1/2! + 2/3!+ 4/5! + 8/9! + 16/17! + 32/33! …. ……..n terms

3. Write a Java program to print the first 15 numbers of the Pell series. In
mathematics, the Pell numbers are an infinite sequence of integers. The
Sequence of Pell numbers starts with 0 and 1, and then each Pell number is the
sum of twice the previous Pell number and the Pell number before that.: Thus,
70 is the companion to 29, and 70 = 2 x 29 + 12 = 58 + 12. The first few terms of
the sequences are: 0, 1, 2, 5, 12, 29, 70, 169, 408, 985, 2378, 5741, 13860…

4. Using a switch statement , write a menu driven program to find the sum of the
following series.

Series 1:
S = 1 + 2 - 3 + 4 - 5 + 6 - 7 + 8 - 9 + ……………… -15

Series 2:
S = (X+1)2+(X+2)3+(X+3)4+(X+4)5+…………… +(X+N)N+1

For an incorrect choice , an appropriate error message should be displayed.

5 Write overloaded function calculate() with following function definitions. void


calculate(int x, int y ) – to calculate the sum of all even numbers from x till y and
print the sum .
void calculate(char a,char n) – to print all vowels from variable a to n if any void
calculate(int x, int y, int z) – to print the middle number from x,y,z if you
arrange them in ascending order.

6 Define a class called Courier with the following description:


Instance variables/data members:
name : to store the name of the customer
weight : to store the weight of the parcel
contact : to store the contact number of the customer
charges : to store the total charges

Member methods:
Courier() : default constructor .
void input() : to accept name , weight, contact number
void cal() : to compute total charges for a parcel as per given
criteria. (Note : service tax Rs. 300 to be paid by all customer irrespective of
weight as part of total charges. )

Weight in gm Charges in Rs.

1 to 100gm 65/=

For next 50 gm 40/=

Above 150 gm @ 2/gm Exceeding 150gm

void display() : display all details

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

7. 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
net – net salary
[ Declare the variables using appropriate data types]
Member methods:
void accept() - accept the details using scanner class
void calculate () -to calculate the net salary as per the given specifications - :
net = basic + hra + da - pf
hra = 18.5% 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 following format


eno ename age basic net

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

8 Define a class Interest having the following description


Instance variables/data members
int p : to store principal amount
double r : to store rate
int t : to store time
double interest : to store the interest to be paid
double amt : to store the amount to be paid

Member methods:
void input() : stores the Principal, rate , time
void cal() : calculate the interest and amount prepaid
void display() : display the principal interest and amount to be paid
Time rate of interest
for one year 6.5%
for 2 years 7.5%
for 3 years 8.5%
for 4 years and more 9.5%
(Note : Time to be taken only in whole years)

9 An Abundant number is a number for which the sum of its proper factors is
greater than the number itself. An deficient number is a number for which the
sum of its proper factors is smaller than the number itself . Write a program to
input a number and check and print whether it is an Abundant or deficient
number or not.

Example:

Consider the number 12.


Factors of 12 = 1, 2, 3, 4, 6 Sum of factors = 1 + 2 + 3 + 4 + 6 = 16

As 16 > 12 so 12 is an Abundant number.

Consider the number 8

Factors of 8 = 1, 2, 4 Sum of factors = 1 + 2 + 4 = 7

As 7 < 8 so 8 is a deficient number

10 A Dudeney number is a positive integer that is a perfect cube such that the
sum of its digits is equal to the cube root of the number. Write a program to
input a number and check and print whether it is a Dudeney number or not.

Example:

Consider the number 512.

Sum of digits = 5 + 1 + 2 = 8
Cube root of 512 = 8
As Sum of digits = Cube root of Number
hence 512 is a Dudeney number.

11 The annual examination result of 50 students In a class is tabulated in a


single dimensional array is as follows
roll number subject A subject B subject C
----- ---------- ----------- ------------- --------

write a program read the data calculate and display the following
a) Average marks obtained by each student
b) Print the roll number and average marks of the students whose average is
above 80
c) Print roll number and the average marks of the students whose average is
below 80

12 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: Output:
str=“success” number of s present is =3
ch=‘s’
(ii) void check(String s1) - to display only vowels from string s1, after
converting it to lower Case if it is in uppercase.
Example:
Input: Output:
s1=“cOmpUter” output : o u e
(iii) void check(int num) – to check the num is palindrome or not.

13 Write a program in Java to accept a String from the user. Print all the letters
of the word in alphabetical order.
Sample Input: computer
Sample Output: cemoprtu

14 Write two separate programs for the following patterns

15 Write a program to accept the names of 10 cities in a single dimension string


array and their STD (Subscribers Trunk Dialing) codes in another single
dimension integer array. Search for a name of a city input by the user in the
list. If found, display “Search Successful” and print the name of the city
along with its STD code, or else display the message “Search Unsuccessful,
No such city in the list’.

16 The marks obtained by 50 students in a subject are tabulated as follows


Name marks
-------------- ----------
-------------- ----------
-------------- ----------
Write a program to input the names and marks of the students in the subject.
calculate and display
a) subject average marks( subject average marks = total marks / 50)
b) the highest marks in the subject and the name of the student( the maximum
marks in the subject are 100)

17. Write a program that encodes a word into Piglatin. To translate a word into a
Piglatin word, convert the word into uppercase and then place the first
vowel of the original word as the start of the new word along with the
remaining alphabets. The alphabets present before the vowel being shifted
towards the end followed by “AY”.
Sample Input (1) : London, Sample Output (1) : ONDONLAY
Sample Input (2) : Olympics, Sample Output (2) : OLYMPICSAY

18 . Write a program that takes a sentence and count and print number of
vowels, consonants, numeric digits and special characters in a sentence.
Assume #,$,%,&,@ are special characters and ignore other special
characters.

19 Write a program using a method Palin( ), to check whether a string is a


Palindrome or not. A Palindrome is a string that reads the same from the
left to right and vice versa.
Sample Input: MADAM, ARORA, ABBA, etc.

20 Write a program in Java to accept a word. Program should checks the string
for the presence of consecutive letters. If two letters are consecutive at any
position then the function prints "It is a magic string", otherwise it prints "It
is not a magic string".
Sample Input: computer
Sample Output: It is not a magic string
Sample Input: DELHI
Sample Output: It is a magic string
-----------------------------------------------

You might also like