Posted in All Posts, Semester 4

Sem 4 – CJ Unit 3 Programs

CJ – Core Java

Unit 3 – Exception Handling and Inheritance

1. Write a program to display the sum of digits of given numbers with exception handling.
Download

2. Write a java program which takes 2 arguments – a string and its length. If the length of the string is not according to given one then throw the user defined LengthMatchException and handles it appropriately.
Download

3. Write a Java program to input n integer numbers and display lowest and second lowest number. Also handle the different exceptions possible to be thrown during execution. Continue reading “Sem 4 – CJ Unit 3 Programs”

Posted in All Posts, Semester 4

Sem 4 – CJ Unit 2 Programs

CJ – Core Java

Unit 2 – Decision Making, Looping, String, Array, Wrapper Classes

1. Write a program to print even number up to 10 using while loop.
Download

2. Write a program to check whether the given number is even or odd.
Download

3. Write a program to demonstrate calculator using switch statement. Continue reading “Sem 4 – CJ Unit 2 Programs”

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.
Download

3. Write a program to find maximum of two numbers without using third variable. Continue reading “Sem 4 – CJ Unit 1 Programs”