Experiments
01 a) Write a program to accept two integer numbers from the standard input and perform the following arithmetic operations: addition, subtraction and multiplication.
b) Write a program to calculate simple and compound interest.
c) Write a Program to Swap Two Numbers with and without temporary variables.
02 a) Write a program that prints all real solutions to the quadratic equation ax2+bx+c=0. Read in a, b, c and use the quadratic formula.
b) Write a Program to display All Prime Numbers from 1 to N.
c) Write a Program for factorial of a number.
03 a) Write a program to search a given element in the array using linear and binary search techniques
b) Write a program to sort the elements in ascending and descending order using bubble sort
c) Write a program to find the largest and smallest element in an array.
04 Given two matrices A and B, write a program to:
a) Add the matrices
b) Multiply the matrices
c) Find the determinant of a matrix
05 Write a program to perform the following:
a) Reverse a string
b) Check for palindrome
c) Compare two strings
06 Create a Java class called Student with the following details as variables within it. USNName Branch and Phone Write a Java program to create n Student objects and print the USN, Name, Branch, and Phone of these objects with suitable headings.
07 Write a Java program to create a class known as “BankAccount” with methods called deposit() and withdraw(). Create a subclass called SBAccount that overrides the withdraw() method to prevent withdrawals if the account balance falls below one hundred.
08 Write a JAVA program demonstrating Method overloading and Constructor overloading
09 Design a super class called Staff with details as StaffId, Name, Phone, Salary. Extend this class by writing three subclasses namely Teaching (domain, publications), Technical (skills), and Contract (period). Write a Java program to read and display at least 3 staff objects of all three categories.
10 a) Write a JAVA program to read two integers a and b. Compute a/b and print, when b is not zero. Raise an exception when b is equal to zero. Also demonstrate working of ArrayIndexOutOfBound-Exception b) Write a Java program to create a method that takes an integer as a parameter and throws an exception if the number is odd
11 Write a Java program to create an abstract class BankAccount with abstract methods deposit() and withdraw(). Create subclasses: SavingsAccount and CurrentAccount that extend the BankAccount class and implement the respective methods to handle deposits and withdrawals for each account type.
12 Create two packages P1 and P2. In package P1, create class A, class B inherited from A, class C . In package P2, create class D inherited from class A in package P1 and class E. Demonstrate working of access modifiers (private, public, protected, default) in all these classes using JAVA
Course Outcomes
Assessment Details (both CIE and SEE):
The student has to secure not less than 35% (18 Marks out of 50) in the semester-end examination (SEE).
Continuous Internal Evaluation (CIE):
CIE marks for the practical course is 50 Marks.
The split-up of CIE marks for record/ journal and test are in the ratio 60:40.
The Sum of scaled-down marks scored in the report write-up/journal and average marks of two tests is the total CIE marks scored by the student.
Semester End Evaluation (SEE):
SEE marks for the practical course is 50 Marks.
SEE shall be conducted jointly by the two examiners of the same institute, examiners are appointed by the University
Suggested Learning Resources:
1. E. Balagurusamy, Programming with Java, Graw Hill, 6th Edition, 2019
2. Herbert Schildt, C: Java the Complete Reference, McGraw Hill, 11th Edition, 2020