Java Assignment-1 Setwise
Java Assignment-1 Setwise
Question 1
Write a Java program to find the factorial of a number.
Question 2
Write a java program with the initialization earning of an employee. The program should
calculate the income tax to be paid by the employee as per the criteria given below:
Slab rate IT rate
Upto Rs. 50,000 Nil
Upto Rs. 60,000 10% on additional amount
Upto Rs. 1,50,000 20% on additional amount
Above Rs. 1,50,000 30% on the additional amount
Hint: - Run: - java calculates 1,25,000
Question 3
Write a program to input n numbers on command line arguments and calculate the maximum of
them.
Question 4
Write a program to print the sum and average of the even and odd numbers separately given on
command line argument.
Question 5
Write a program to print the following pattern given n as argument:- [for input 3]
1
2 2
3 3 3
Question 6
Write a program to print all the prime numbers in an array of n elements by taking command line
arguments.