Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
17 views

3078java Assignments

The document lists 15 assignments for a Java lab course. The assignments include writing programs to calculate factorials, determine if a number is Armstrong or a palindrome, perform method overloading, create classes for employees and students with inheritance, handle exceptions, select Java files from a list of files, and create basic graphical user interfaces with buttons and text fields.

Uploaded by

Nitish Jha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

3078java Assignments

The document lists 15 assignments for a Java lab course. The assignments include writing programs to calculate factorials, determine if a number is Armstrong or a palindrome, perform method overloading, create classes for employees and students with inheritance, handle exceptions, select Java files from a list of files, and create basic graphical user interfaces with buttons and text fields.

Uploaded by

Nitish Jha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

17th July 2023

SE (IT) SEM-III

ITC304: JAVA LAB (SBL)

List of Assignments

Assig
BLOOM’S Mappi Mappi
nmen Question
LEVEL ng LO ng PO
t No

1. Five Bikers Compete in a race such that they drive at PO1-


a constant speed which may or may not be the same PO5,
as the other. To qualify the race, the speed of a racer L1, L2
must be more than the average speed of all 5 racers. LO1 PO8,
Write a Java program to take as input the speed of PO10,
each racer and print back the speed of qualifying PO12
racers.
2. Write a menu driven Java program which will read PO1-
a number and should implement the following L1, L2 PO5,
1. methods LO1 PO8,
A)factorial() B)testArmstrong() PO10,
C)testPalindrome() D)testPrime() PO12
E) fibonacciSeries()
PO1-
L1, L2 PO5,
3. Create a Java based application to perform various LO1 PO8,
ways of Method overloading. PO10,
PO12

2. 4. Write a program that would print the information


(name, year of joining, salary, address) of three
L3 PO1-
employees by creating a class named 'Employee'.
The output should be as follows: PO5,
LO2 PO8,
PO10,
PO12

5. Create a class 'Student' with three data members L3 LO2 PO1-


which are name, age and address. The constructor of PO5,
the class assigns default values name as "unknown",
age as '0' and address as "not available". It has two
members with the same name 'setInfo'. First method PO8,
has two parameters for name and age and assigns the PO10,
same whereas the second method takes has three PO12
parameters which are assigned to name, age and
address respectively. Print the name, age and address
of 10 students. Hint - Use array of objects.
PO1-
6. Print the sum, difference and product of two PO5,
complex numbers by creating a class named L3 LO2 PO8,
'Complex' with separate methods for each operation
whose real and imaginary parts are entered by user. PO10,
PO12
PO1-
L3 PO5,
7. Print Reverse Array list in java by writing our own
LO2 PO8,
function
PO10,
PO12
3. 8. Create a class Book and define a display method to PO1-
display book information. Inherit Reference_Book PO5,
and Magazine classes from Book class and override L3
LO3 PO8,
display method of Book class in Reference_Book
and Magazine classes. Make necessary assumptions PO10,
required PO12
9. A university has two types of students — graduate L3 LO3 PO1-
students and research students. The University PO5,
maintains the record of name, age and programme of PO8,
every student. For graduate students, additional
PO10,
information like percentage of marks and stream,
like science, commerce, etc. is recorded; whereas for PO12
research students, additionally, specialization and
years of working experience, if any, is recorded.
Each class has a constructor. The constructor of
subclasses makes a call to constructor of the
superclass. Assume that every constructor has the
same number of parameters as the number of
instance variables. In addition, every subclass has a
method that may update the instance variable values
of that subclass. All the classes have a function
display_student_info( ), the subclasses must override
this method of the base class. Every student is either
a graduate student or a research student.
Perform the following tasks for the description given
above using Java :
(i) Create the three classes with proper instance
variables and methods, with suitable inheritance.
(ii) Create at least one parameterised constructor for
each class.
(iii) Implement the display_student_info( ) method
in each class
10. An employee works in a particular department of an
organization. Every employee has an employee
number, name and draws a particular salary. Every
department has a name and a head of department. PO1-
The head of department is an employee. Every year L3
PO5,
a new head of department takes over. Also, every
year an employee is given an annual salary LO3 PO8,
enhancement. Identify and design the classes for the PO10,
above description with suitable instance variables PO12
and methods. The classes should be such that they
implement information hiding. You must give logic
in support of your design. Also create two objects of
each class.
11. Java Program to Create Account with 1000 Rs
Minimum Balance, Deposit Amount, Withdraw
Amount and Also Throws LessBalanceException. It L3 PO1-
has a Class Called LessBalanceException Which PO5,
returns the Statement that Says WithDraw LO4 PO8,
Amount(_Rs) is Not Valid. It has a Class Which PO10,
Creates 2 Accounts, Both Account Deposite Money PO12
and One Account Tries to WithDraw more Money
4. Which Generates a LessBalanceException Take
Appropriate Action for the Same.
12. You have been given the list of the names of the files
in a directory. You have to select Java files from PO1-
them. A file is a Java file if it’s name ends with PO5,
“.java”. For e.g. File- “Names.java” is a Java file, L3 LO4 PO8,
“FileNames.java.pdf” is not. PO10,
Input: test.java, ABC.doc, Demo.pdf, add.java, PO12
factorial.java, sum.txt
Output: tset.java, add.java, factorial.java
5. 13. Write a program to create a window with four text PO1-
fields for the name, street, city and pincode with PO5,
suitable labels. Also windows contains a button L6
MyInfo. When the user types the name, his street, LO5 PO8,
city and pincode and then clicks the button, the PO10,
type’s details must appear in Arial Font with Size PO12
32, Italics.
PO1-
PO5,
14. Write a Java Program to create a Student Profile L6
LO5 PO8,
form using AWT controls.
PO10,
PO12
15. Write a Java Program to create a color palette. L6 LO5 PO1-
Declare a grid of Buttons to set the color names. PO5,
Change the background color by clicking on the PO8,
color button.
PO10,
PO12
PO1-
PO5,
16. Write Java program to draw various shapes on L6
6 LO6 PO8,
Canvas using JavaFX
PO10,
PO12

Meena Ugale / Chhaya Dhavale / Sulochana Devi


(Lab In-charge – IT Dept.)

You might also like