Core Java Practicals Sybscit
Core Java Practicals Sybscit
1 Write a java code to get the output as shown below if the user input the String 20
‘D’.
A
BA
CBA
DCBA
2 Design a class to represent a bank account. Include the following members: 20
Data Members:
1) Name of the depositor 2)Account number 3) Type of
account(Savings/Current) 2) Balance amount in the account(Minimum balance
is Rs.500.00)
Methods:
1) To read account number, Depositor name, Type of account
2)To deposit an amount ( Deposited amount should de added with it)
3) To withdraw an amount after checking balance(Minimum balance must be
Rs.500.00)
4) To display the balance
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java program to create a class Employee with a name & salary. Create a 20
class Manager inherited from Employee. Add an instance variable department.
Create a class Executive inherit from Manager and add an instance variable
location. Write the class definitions, the constructors and methods that read and
display the information
2 Design an AWT application to check whether the number entered in textbox is 20
prime or not.
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java program that copies content of one file to another. While copying 20
the destination file should be an encrypted file. For example A is represented as
C, B as D, C as E, and D as F and so on.
2 Design an AWT application to accept a number from user through textbox and 20
print its reverse.
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java code to input height (in inches) and convert it into feet and inches. 20
Display the final result in feet and inches. For e.g. if height is 77 inches then
after conversion it will be 6 feet 5 inches. [ 1 feet=12 inches]
2 Write a Java code to implement MouseListener and MouseMotionListener. 20
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java program to input Basic salary of a person and calculate Net salary 20
in Rs. after increasing his salary as per the following criteria and Display the
Net Salary.
Basic(Rs.) %increase
< 3000 2
>=3000 <5000 5
>=5000 <10000 10
Above 10000 20
2 Write a Java program for multiplying two matrices and print the product for the 20
same
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java program that translates a letter grade into a number grade. Letter 20
grades are A, B, C, D, and F possibly followed by + or -. Their numeric values
are 4,3,2,1 and 0. There is no F+ and F-. + increases the value by 0.3 and –
decreases the value by 0.3. However A+ has the value as 4.0 only. For example
Enter the grade : B-
The numeric value is : 2.7
2 Write a Java program to merge the contents of two file into a single file. 20
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java program to accept the credit card type and shopping amount from 20
the user and then display the Net Price as Net Price= Shopping Amount –
Discount.
The discount is calculated based on credit card and total shopping amount as
follows:
Credit Card Type Shopping Amount Discount (%)
VISA <5000 10
>=5000 20
XYZ <10000 15
>=10000 25
ABC <8000 12
>=8000 15
2 Write a Java program to convert a decimal number to binary number. 20
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a java program to input two numbers x and y and count total number of 20
prime numbers between x and y. For example if x=1 and y=10 then o/p is 4.
2 Write a Java Program to find the largest and smallest element from an array. 20
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java program to create a class account with attributes acc_no, name and 20
balance. Initialize the values through parameterized constructor. If balance
between 1000 and 5000 generate a user defined exception “Balance within the
range”.
2 Write a Java AWT program to accept a number from user (TextBox) and 20
display the cube of the number.
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
2 Write a Java program that prompts the user(using Buffered Reader) for a radius and 2
then prints 0
a. Area and Circumference of the circle with that radius
b. Volume ((4/3)*Pi*R3) )and Surface Area(4*Pi*R2) of the sphere with that
radius
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java program that prompts the users for 2 integers using command line 20
argument and then prints (i) sum (ii) difference (iii) product (iv) average (v)
maximum (vi) minimum. Write methods to calculate the same.
2 Write an AWT Program to design the Following GUI 20
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a java program to input a number from user and print the sum of its odd 20
factors only. Example: - If number is 36 then its factors are 1,2,3,4,6,9,12,18
and sum of its odd factors is 1+3+9=13.
2 Write a java Program to input any digit number and print the sum of only its 20
even digits. Example: 2354=2+4=6.
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Design an abstract class called Shape which has three subclasses say Triangle, 20
Rectangle, and Circle. Define one method area () in the abstract class and
override this area () in these three subclasses to calculate for specific object i.e.
area () of Triangle subclass should calculate area of triangle etc. Same for
Rectangle and Circle
2 Write a java program for multiplying two matrices and print the product for the 20
same.
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Define 2 packages (i) Prime (ii) Factorial. Write a Java program to create a class 20
PrimeFact to import these packages.
2 Write a java program to copy the contents from one file to other file. 20
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
iii) A method ShowTravel( ) to display the content of all the data members on
screen. WAP to create an object of class Travel and invoke all its methods
2 Write a Java program to accept a sentence from user using command line 20
argument and store it in a file data.txt.
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java program that translates a number between 0 to 4 into the letter 20
grades as F, D, C, B and A. For example if the number entered is 2.8 then grade
is B and if number entered is 2.3 then grade would be C.
2 Write a Java AWT program to calculate area of Rectangle. 20
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java program to create a class student with attributes roll no, name, age 20
and course. Initialize values through parameterized constructor. If age is not
between 15 and 21 then generate a user defined exception “Age not within the
range”.
2 Write a Java program to sort the array in ascending and descending order 20
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Define 3 packages Rectangle, Square and Triangle each having area of their 20
respective shape. Create a class ShapeDemo importing these 3 packages and
displaying the area of rectangle, square and triangle
2 Write a Java program to convert digit into words.(E.g.: 12 One Two) 20
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a Java program called CozaLozaWoza which prints the number 1 to 110, 20
11 numbers per line. The program shall print "Coza" in place of the numbers
which are multiples of 3, "Loza" for multiples of 5, "Woza" for multiples of 7,
"CozaLoza" for multiples of 3 and 5, and so on. The output shall look like:
1 2 Coza 4 Loza Coza Woza 8 Coza Loza 11
Coza 13 Woza CozaLoza 16 17 Coza 19 Loza CozaWoza 22
23 Coza Loza 26 Coza Woza 29 CozaLoza 31 32 Coza
2 Write a Java AWT program to calculate area of Circle. 20
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Design a student class. A student has a name, stipend, and enrolment number. 20
Write a default constructor and a constructor with two parameters (name and
enrolment number) and two methods.
(a) To return the name and enrolment number.
(b) A method that increases the student’s stipend.
Write a small program that tests your class.
2 Write a Java code to design the following GUI and perform the arithmetic 20
operation.
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
1 Write a java program for swapping of two n dimensional arrays. Accept the 20
array element from user.
2 Write a Java AWT code to calculate the factorial of a number for the following 20
Gui
3 Viva 5
4 Journal 5
UNIVERSITY OF MUMBAI
S.Y.B.Sc. (INFORMATION TECHNOLOGY) (Semester IV) (Practical) EXAMINATION
FIRST HALF 2018
Core Java
Seat No: ___________ Max. Marks: 50
2. Viva 5
3. Journal 5