Computer Project Work 2022-23
Computer Project Work 2022-23
Solution :
Class fine
Double f=0;
If ( n<=5 )
f=0.40*n;
f= 0.40*n+0.65*(n-5);
If( n>10)
f = 0.40*n+0.65*n+0.80*n (n-10);
System.out.println (“f”);
}
2) Mr. A.P. Singh is a software engineer . He pays annual income tax as follows:
Solution:
class tax
Double t = 0;
If ( s<=100000)
t=0;
t= 100000/100*10;
t=5000+250000/100*20;
if (s<250000)
t= 25000+25000/100*30;
System.out.println (“t”);
}
3) Discount table of a cloth shop is as follows:
Solution:
class discount
Double t=0;
If (c<2000)
t=5;
t=25;
t=35;
if ( c>10000)
t=50;
System.out.println(“t”);
}
4) In an exam grades are equal to the marks obtained as in the given table :
Solution:
class grade
Double g = 0;
If ( m >80)
System.out.println (“Distinction”)
System.out.println(“Pass”)
If ( m<40)
System.out.println (“Fail”)
}
}
class sum
while(d=0);
int d= a+ b+ c;
System.out.println (“d”);
SOLUTION:
class Armstrong
Void main ()
n=m;
m=n;
r=n%10
s=r+n
}
if ( s=n)
System.out.println(“ It is Armstrong”)
else
22
333
4444
55555
SOLUTION :
Class loop
Void main ()
Int I; int j;
System.out.print (i);
System.out.println (“ “ );
SOLUTION:
Class palindrome
While ( n!=0)
r=n%10;
n=n/10;
p=p*10+r;
If( p==n)
System.out.println (“ It is palindrom”)
Else
System.out.println(“ It is not “);
Solution :
class sum
while(d=0);
int d= a+ b+ c;
System.out.println (“d”);
Solution:
class PrimeNumber {
void main(String args[]) {
p = new PrimeNumber();
Scanner scan = new Scanner(System.in);
System.out.println(“Enter a number for check in main method:”);
int n = scan.nextInt();
int count = 0;
int number = 0;
for (int i = 2; i <= 9; i++) {
if (n % i == 0) {
System.out.println(" count called when " + i);
count = count + 1;
}
number = number + 1;
System.out.println(" The loop called "+number+" times");
}
if (count == 0) {
System.out.println(n + " is a prime number ");
}
11) Calculate and display the net salary according to the following table:-
NO. BS DA HRA PF
SOLUTION :
class salary
{
Double t=0;
If (c<=900)
t=90;
t=105;
t=115;
if ( c>20000)
t=120;
System.out.println(“t”);
Solution:
Class even
Void main ()
Int i=2;
While (i<=20);
System.out.println(i);
i=i+2
Solution:
Class niven
While (n!=0)
r=n%10;
n=n/10;
}
if ( n%s==0)
System.out.println(“It is niven”)
Else
}
}
15) Write a program in bluej to check whether a no. is neon no. or not:-
Solution:
Class neon
R=m%10;
N=m/10;
S=s+r;
If ( n==s)
Else
System.out.println(“it is not”)
16) Write a program in bluej to check whether a no. is duck no. or not.
Solution:
Class duck
{
viod main( int n)
While ( n!=0)
R=n%10;
N=n/10;
If ( r==0);
K=k+1;
If ( k>0)
Else
************************************************************************