Computer Project
Computer Project
Application
th
Class: 10 B
Session: 2021-22
1
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Index
CONTENT PAGE
NUMBER
Assignment 1 4
Assignment 2 9
Assignment 3 13
Assignment 4 17
Assignment 5 21
Assignment 6 27
Assignment 7 32
Assignment 8 39
Bibiliography 43
2
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Acknowledgement
3
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Assignment-1
Using the switch statement, write a menu
driven program for the following:
(i)To print the Floyd’s triangle [Given below]
1
23
456
7 8 9 10
11 12 13 14 15
(ii)To display the following pattern based on
value of n. For example if n=5 then print,
54321
4321
321
21
1
4
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Synopsis
For this assignment, nested for loop is
going to be used. First, input is taken
from Scanner class. Then using switch
case menu is created, and in first case,
by taking the number of rows as input,
FOR LOOP is nested and a new
variable with the value 1 is printed and
its value is increased by 1.
In the second case, first n is taken as
input, then using FOR LOOP, the given
triangle is displayed.
Source Code
import java.util.*;
5
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
class Sample
int n= sc.nextInt();
switch(n)
case(1):
int r = sc.nextInt();
int i,j,k=1;
for(i=1;i<=r;i++)
for(j=1;j<=i;j++)
System.out.print(k+" ");
k=k+1;
System.out.println();
break;
case(2):
int a,b;
for(a=in;a>=1;a--)
for(b=a;b>=1;b--)
System.out.print(b+" ");
6
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
System.out.println();
break;
default:
System.out.println("Error");
break;
7
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Assignment-2
8
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Write a program in Java to accept a number
and check whether it belongs to the
Fibonacci Series (sequence) or not.
Fibonacci Series:
The Fibonacci Sequence is the series of
numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …
The first two numbers in the series is ‘0’ and
‘1’ and every next number is found by adding
up the two numbers before it.
The 2 is found by adding the two numbers
before it (1+1) Similarly, the 3 is found by
adding the two numbers before it (1+2), And
the 5 is (2+3), and so on!
Example: the next number in the sequence
above would be 21+34 = 55
Here is a longer list: 0, 1, 1, 2, 3, 5, 8, 13, 21,
34, 55, 89, 144, 233, 377, 610, 987, 1597,
2584, 4181, 6765, 10946, 17711, 28657,
46368, 75025, 121393, 196418, 317811…
Synopsis
9
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
In this program, WHILE LOOP
has been used. First, input is taken
from SCANNER CLASS. Then in
the loop, two main variables are
added and the value is added in the
third variable. Then, second
variable’s value is stored in the
first variable and the third
variable’s value is stored in the
second. The loop is continued till
infinity. Next, using IF-ELSE
STATEMENT, it is checked if the
input in in the Fibonacci Series.
Source Code
10
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
import java.util.*;
class Sample
System.out.println("Enter a number:");
int in = sc.nextInt();
while(c<in)
c = a + b;
a = b;
b = c;
if(c==in)
else
11
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Variable Description Table
Assignment-3
The International Standard Book Number (ISBN) is a
unique numeric book identifier, which is printed on
every book. The ISBN is based upon a 10-digit code.
The ISBN is legal if 1*digit1 +2*digit2 + 3*digit3 +
12
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
4*digit4 + 5*digit5 + 6*digit6 + 7*digit7 + 8*digit8 +
9*digit9 + 10*digit10 is divisible by 11.
Example: For an ISBN 1401601499 Sum=1*1 + 2*4 +
0*0 + 4*1 + 5*6 + 6*0 + 7*1 + 8*4 + 9*9 + 10*9 = 253
which is divisible by 11.
Write a program to: (i) input the ISBN code as a 10-
digit number
(ii) If the ISBN is not a 10-digit number, output the
message “Illegal ISBN” and terminate the26 program
(iii) If the number is 10-digit, extract the digits of the
number and compute the sum as explained above. If the
sum is divisible by 11, output the message “Legal
ISBN”. If the sum is not divisible by 11, output the
message “Illegal ISBN”.
Synopsis
In this program, concept of Strings and
Functions has been used. First, the
number is input in a string variable.
13
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Then it is checked whether there are 10
digits or not. Then further using FOR
LOOP, each of its digit is multiplied
with its position and then added with
the other. At last, using conditional
statements it is checked if the remainder
of sum and 11 is 0. If yes, then
“LEGAL ISBN” is displayed. If not,
then “ILLEGAL ISBN” is displayed.
Source Code
import java.util.*;
class Sample
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter a number:");
String in = sc.nextLine();
int len = in.length();
if(len!=10)
{
System.out.println("Illegal ISBN");
}
14
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
int sum = 0,num,i,pro;
for(i=0;i<=9;i++)
{
num = in.charAt(i);
pro = num * (i+1);
sum = sum + pro;
}
if(sum%11==0)
{
System.out.println("Legal ISBN");
}
else
{
System.out.println("Illegal ISBN");
Assignment-4
An Emirp number is a number
which is prime backwards and
forwards. Example: 13 is an
Emirp number since 13 and 31
are both prime numbers. Write
a program to accept a number
16
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
and check whether it is an
Emirp number or not.
Synopsis
In this program, nested loops and
conditional statements have been used.
First the number is input. Then using
FOR LOOP, it is checked if it is a
prime number. A variable in it was used
to do so. Further it is equated with
2( because a prime number can be
divided 2 times). If true, then by digit
chopping, it is reversed. In the next
step, the reverse number is checked
with the same method. Finally the
17
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
statement is displayed as per the
situation.
Source Code
import java.util.*;
class Sample
System.out.println("Enter a number:");
int in = sc.nextInt();
int oN = in;
if(in % i == 0)
cv1++;
if(cv1==2){
while(oN>0){
dig = oN % 10;
oN = oN / 10;
rN = rN * 10 + dig;
if(rN % i == 0){
cv2++;
if(cv2==2){
18
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
}
else{
else{
}}
19
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
cv2 Int No. of divisions
dig Int Enter digit
i Int Operate loop
rN int Reverse no.
Assignment-5
Write a menu driven program in Java to provide the
following options to generate and print output based on
user’s choice:
(a) To input a number and check whether it is a NEON
number or not
(b) To print the REPUNIT series: 1, 11, 111, 1111, ….
upto 'n' terms
(c) To print the sum of factorial of first n terms, where
n is input by the user.
For example if n=5 then sum=1+2+6+24+120=153
which is the sum of 1!+2!+3!+4!+5!
A number is said to be NEON, if sum of all the digits
of the square of the number is equal to the number
itself.
For example 9 is a NEON number. (Workings: Square
of 9 = 81. Sum of digits of square: 8 + 1 = 9) For an
incorrect menu choice an appropriate error message
should be displayed
20
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Synopsis
In this program, first input is taken to
know user’s choice. First option was to
check if input is a NEON NUMBER. First
its square was done then by digit chopping,
its sum was calculated. At last, using
conditions, answer was displayed.
Second option was of REPUNIT SERIES.
Here, the range of printing 1 together was
given by the user. Using FOR LOOP, the
task was done and the answer was
displayed.
Third option was the sum of factorial
series. Here, nested WHILE LOOP, was
used and the sum was displayed.
21
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Source Code
import java.util.*;
class Sample
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter 1 for NEON NUMBER:");
System.out.println("Enter 2 for REPUNIT SERIES:");
System.out.println("Enter 3 for FACTORIAL SERIES:");
int in = sc.nextInt();
switch(in)
{
case(1):
System.out.println("Enter a Number:");
int a = sc.nextInt();
int sqr = a * a; int dig,sum = 0;
while(sqr>0)
{
dig = sqr % 10;
sum = sum + dig;
sqr = sqr / 10;
}
if(sum==a){
System.out.println("It is a NEON NUMBER.");
}
else{
System.out.println("It is not a NEON NUMBER.");
}
break;
case(2):
22
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
System.out.println("Enter the range:");
int b = sc.nextInt();
int i,j=0;
for(i=1;i<=b;i++){
j = j * 10 + 1;
System.out.print(j+", ");
}
break;
case(3):
System.out.println("Enter the range for factorial sum:");
int c = sc.nextInt();
int f = 1; int fsum = 0; int l = 1,m = 1;
while(l<=c){
while (m<=l){
f = f * m;
m++;
}
fsum = fsum + f;
l++;
}
System.out.println("SUM:"+ fsum);
break;
default:
System.out.println("Error");
break;
}
}
}
23
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Input & Output Window
24
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Variable Description Table
f Int Factorial
25
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Assignment-6
A Credit card company allows a limit to spend Rs. 15000 to
its clients. It also offers cash back facility according the table
shown below. Input the amount spent by the user and display
the cash back amount that he is entitled to.
Synopsis
26
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
In this program, IF AND ONLY IF
STATEMENT is used.
First name is taken as input then the
amount spent.
If the amount is greater than 0, first
condition is satisfied.
Further, as per the question, cashbacks
with extra cashback is given.
In the first case, extra is 0; in second it
is 2% of amount above 1000 and in this
way, it was carried out.
Source Code
import java.util.*;
class Credit
{
27
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter your name:");
String name = sc.nextLine();
System.out.println("Enter your amount:");
float amt = sc.nextFloat(); double cb; double ecb = 0;double temp = amt;
if(amt>0){
if(amt==1000){
cb = 100 + ecb;
System.out.println("Amount entered: " + temp);
System.out.println("CashBack eligible: "+cb);
}
if(amt>1000 && amt<=3000){
ecb = 0.02 * (temp - 1000);
cb = 200 + ecb;
System.out.println("Amount entered: " + amt);
System.out.println("CashBack eligible: "+cb);
}
if(amt>3000 && amt<=7000){
ecb = 0.04 * (temp - 3000);
cb = 400 + ecb;
System.out.println("Amount entered: " + amt);
System.out.println("CashBack eligible: "+cb);
}
if(amt>7000 && amt<=15000){
ecb = 0.08 * (temp - 8000);
cb = 800 + ecb;
System.out.println("Amount entered: " + amt);
28
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
System.out.println("CashBack eligible: "+cb);
}
}
else{
System.out.println("Wrong Amount input.");
}
}
}
29
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Assignment-7
An electronic shop has announced the following
seasonal discount on purchase of certain items.
Purchase amount in Discount on Laptop Discount on Desktop
Rs. PC
0-25000 0.0% 5.0%
25001-57000 5.0% 7.5%
57001-100000 7.5% 10.0%
30
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
More than 100000 10% 15.0%
Synopsis
In this program, IF AND
ONLY IF STATEMENT is
used. First, name address and
choice has been taken. Then
31
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
choice was used in switch case
and further, using conditional
statements and jump
statements, the entire program
was executed.
Source Code
import java.util.*;
class Eletronics
switch(item){
case("L"):
32
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
System.out.println("Enter your amount:");
if(amt>0){
if(amt<=25000){
dis = 0;
System.out.println("Address: "+adr);
System.out.println("Discount: "+dis);
break;
System.out.println("Address: "+adr);
System.out.println("Discount: "+dis);
break;
System.out.println("Address: "+adr);
System.out.println("Discount: "+dis);
break;
if(amt>100000){
System.out.println("Address: "+adr);
System.out.println("Discount: "+dis);
33
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
break;
else{
System.out.println("Wrong Input!");
break;
case("D"):
if(amt1>0){
if(amt1<=25000){
System.out.println("Address: "+adr);
System.out.println("Discount: "+dis1);
break;
System.out.println("Address: "+adr);
System.out.println("Discount: "+dis1);
break;
System.out.println("Address: "+adr);
System.out.println("Discount: "+dis1);
break;
34
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
}
if(amt1>100000){
System.out.println("Address: "+adr);
System.out.println("Discount: "+dis1);
break;
else{
System.out.println("Wrong Input!");
break;
default:
break;
}}}
35
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Variable Data Type
name String
adr String
item String
amt Double
dis Double
temp Double
namt Double
amt1 Double
dis1 Double
36
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Variable
temp1 Description
Double Table Store amount
Assignment-8
Mr. A. P. Singh is a software engineer. He pays
annual income tax as per the given table:
Annual Salary Rate of Income Tax
Upto Rs. 100000 No Tax
Rs.100001 to Rs.150000 10% of the amount
exceeding Rs.1 ,00,000
Rs.150001 to Rs.250000 Rs.5000 + 20% of the
amount exceeding
Rs.1,50,000
Above Rs.250000 Rs.25,000 + 30% of the
amount exceeding
37
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Rs.2,50,00
Synopsis
In this program, IF AND
ONLY IF STATEMENT has
been used. First input is taken
from the user. In the first
condition, if amount is equal to
38
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
0, wrong input message is
displayed.
In the second condition,
amount below 100k got no tax.
Similarly like this , other
Source Code
conditions are fulfilled
import java.util.*;
class Taxation
if(temp==0){
System.out.println("Wrong Input!");
etax = 0;
tax = 0;
System.out.println("Tax: "+tax);
39
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
etax = temp - 100000;
System.out.println("Tax: "+tax);
System.out.println("Tax: "+tax);
if(temp>250000){
System.out.println("Tax: "+tax);
40
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Variable Data Uses
Type
sal Double Input salary
tax Double Calculate tax
etax Double Additional tax
temp Double Store salary
41
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Assignment-9
Write a menu driven program to generate the
uppercase letters from Z to A and lowercase
letters from a to z as per the user’s choice.
Enter ‘1’ to display upper case letters and ‘2’ for
lower case letters.
Synopsis
In this program, first input is to be taken
from the user regarding its choice. Then
the input will be used as a counter variable
in the switch case for performing the given
task. In the first case, letters from ‘Z’ to
‘A’ will be printed using their respective
ASCII codes. In the second case, letters
from ‘a’ to ‘z’ will be displayed using the
same phenomenon.
42
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Source Code
43
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File
Bibiliography
The following PROJECT WORK is for the
academic session of 2021-22 for class 10th.
It has been completed by Rushil Mishra of
W. H. SMITH MEMORIAL SCHOOL.
The work has got 8 assignments with its
synopsis, source code, input and output
window and the variable description table.
The work has been entirely done from the
concepts explained in the class lectures.
No external references has been taken;
neither from any website, nor from any
book.
Thank You
Rushil Mishra
44
RUSHIL MISHRA/10TH B/ ICSE 2021/Computer Application/Practical File