[Go to site: main page, start]

0% found this document useful (0 votes)
8 views2 pages

Java Programming Assignment Tasks

Uploaded by

subhash.chandra
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)
8 views2 pages

Java Programming Assignment Tasks

Uploaded by

subhash.chandra
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

JAVA PROGRAMMING

ASSIGNMENT1
1. Write a program to find factorial of a number with recursion and iteration.
2. Write a program to reverse a number take input from command line argument.
3. Write a program to display the triangular pattern of *.
4. JAVA program which will accept three numbers from user. If the numbers are different
then print the sum of these numbers and if these three numbers are equal then print the
multiplication of these numbers.
[For example, If A= 1, B = 2, C = 3 then print 6; If A=2, B=2, C=2 then print 8]
5. Write a Java Program to Make a Simple Calculator Using switch...case and Scanner
class.
6. Write a program to print Fibonacci series using functions
7. Write a program to Search an Element in an Array in java.
8. Write a program for finding out minimum and maximum number of an array in java.
9. Calculate income tax for the given income by adhering to the below rules

Taxable Income Rate (%)


First 5,000 0
Next 10,000 10
Next 10,000 20
The remaining 30

For example, suppose that the taxable income is 65,000 the income tax payable is
5000*0% + 10000*10% + 10000*20%+40000*30= 15000
10. Create 2 packages P1 & P2 and create classes Student and BTech in P1 and P2
respectively. Check the accessibility using all the access modifiers.
11. Write a program for checking the speed of drivers. The program will accept the input
speedfrom user and print the messages according to following conditions
 If speed is less than 70, it should print “Ok”.
 Otherwise, for every 5km above the speed limit (70), it should give the driver
one demerit point and print the total number of demerit points. For example, if the
speedis 80, it should print: “Points: 2”.
 If the driver gets more than 12 points, the function should print: “License
suspended”
12. Provide three classes named Rectangle,Triangle, and Circle such that each one of the
classes extends the class Shape. Each oneof the classes contains only the method print
Area () that prints the area of the given shape.
13. Write a Java IO program to read File.
14. Write a Java IO program to read & write in a File.
15. Write a Program to create sockets and establishment connection between client and
server with read and write in both the way (Chat application).
16. Write a java program to take temperature at command line in Celsius and convert in
Fahrenheit.
17. Design a class named Circle. Construct three circle objects with radius 3.0, 3.2, 4.1 and
display the radius and area of each. A no-arg constructor set the default value of radius to
1. A getArea() function is used to return the area of circle. Now implement the class.
18. Write a program for finding out Row wise sum and column wise sum of two dimensional
arrays. Take input from user using scanner class.
19. Write a program for implementation of Method overloading.
20. Create a class named Shape which has three methods named Perimeter. Implement the
concept of Method overloading to calculate the Perimeter of Square, Rectangle and
Circle. In Main Method Take input parameter for Different shape from the user.

You might also like