Posted in All Posts, Semester 4

Sem 4 – CJ Unit 1 Programs

CJ – Core Java

Unit 1 – Java Introduction, Operator, Objects, Methods

1. Write a program to calculate the hypotenuse of right angled triangle when other sides of the triangle are given. (Hypotenuse = Square root (x*x + y*y)).
Download (Input using command line) | Download (Input using scanner method)

2. Write a program to evaluate simple interest of a given principal, rate and time.

3. Write a program to find maximum of two numbers without using third variable.

4. Write a program using the arithmetic operators to perform algebraic operations on two numbers. (Algebraic operation is +, – , *, /, %).

5. Write a program to calculate the area of square and rectangle by overloading the area method.

6. Write a java program to display powers of 2 i.e. 2, 4, 8, 16 etc. up to 1024 using bitwise operators.

7. Write a java program to scan 3 integer values from the user and display the minimum using conditional operator.

8. Write a program to convert inches to centimeters.

9. Create a complex number class. The class should have a constructor and methods to add, subtract and multiply two complex numbers and to return the real and imaginary parts.

Download All Programs

I hope that you found this article to be helpful.
Please share your thoughts in the Comments Section.

Please like our Facebook page to show your support.

Suggested Reading

Comment your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.