Software Lab V Model Questions
Software Lab V Model Questions
Software Lab V
Time: 3 hrs.
1. Create an abstract class called Shape with an abstract method area () and variables d1, d2.
Define a constructor for initializing d1& d2. Create subclasses Rectangle, Triangle,
Square and Circle so that area() will calculate area for each shape. (Invoke area() using
the reference variable of Shape) [ USE ABSTRACT CLASS]
2. Write an AWT program to create two buttons namely Green and Red. While clicking the
button Green, the background color of button ‘green’ should become green and while
clicking the button Red the background color of button ‘Red’ should become Red
PRACTICAL EXAMINATION DECEMBER 2018
Software Lab V
Time: 3 hrs.
1. Create a class Nationalized with a data members balance, customer name, account
number and suitable member functions. Bank also has 2 methods withdrawal (int
amount) and deposit (intamount, int yrs). Create a subclass of Nationalized named
NewGen.In nationalized bank, the maximum amount that can be withdrawn is 25000
and the minimum balance is 500. The interest rate for fixed deposits is 12.5%. In
NewGen bank the maximum amount withdrawn is 45000 and minimum balance is 0.
The interest rate for fixed deposits is 10.5%. Write a program to display the details of
account in Nationalized and NewGen. (Use dynamic method dispatch)
2. Write an AWT program to handle mouse events
1. Define a Student class(Id, Name, Age) using constructor overloading with different no. of
parameter list. (Overloaded constructor - 1. no argument constructor(intialize members
with some default values). 2. single parameter(initialize only one member variable
and remaining with some default values). 3. pass all values to initialize. 4.
pass the object of Student class itself. Write a complete program to implement this
2. Write a program to check how many characters and how many words in a line of text in
textarea
PRACTICAL EXAMINATION DECEMBER 2018
Software Lab V
Time: 3 hrs.
1. Write a package to find out factorial of a number. Import the package to find out nCr
2. Write an AWT program to check a given number is palindrome or not
1. Define a class employee with empid, empname, empsal as class member variables.
Define a parameterized constructor for assigning initial values. Define one more member
function for finding netpay (netpay = sal+ da (da is 10% of salary)).
2. Write a Java Program that displays a list item containing the names of days in a week. If
the user clicks on each of these days, selected day should be displayed onto a Label
PRACTICAL EXAMINATION DECEMBER 2018
Software Lab V
Time: 3 hrs. Max Marks: 80
1. Define a class Employee with empno, name, designation. Define a class partEmp which
is the subclass Of Employee has its data member as noofhrsworked and hourlySal, Write
a complete program to implement it(use consturctors to initialize the values.)
1. Write a console program to find the reverse of a number and check the number is
palindrome or not
1. Write a java program which will race an exception called ArmstrongException when you
input an Armstrong number
2. Write an applet program to find the sum of two integers (use labels, textboxes and buttons
whenever necessary)
PRACTICAL EXAMINATION DECEMBER 2018
Software Lab V
Time: 3 hrs Max Marks: 80
1. Create a class matrix which contains a 2d integer array, m & n as data member. Include
the following member functions:
Q1. Write an Applet program to draw a line graph with values X= {2010, 2011, 2012, 2013}
y= {250,140,360,220}
Q2.Write a Java program to print sum of digits of a given number. If the number is less than 100
or greater than 999 then throw a user defined exception.
Q2.Create an interface Volume, a class Circle and a derived class Cylinder from Volume and
Circle. Volume has member function calculate Volume (), and a constant data member pi(3.14),
Circle has data member readRadius(). Write a java program to compute volume of cylinder using
the above relationship.
Max Marks: 80 (Q1: 25 Marks, Q2: 35 Marks, Record: 10 Marks, Viva: 10 Marks)
Q1.Write a java GUI program to find area of a circle(Area= 𝜋 ∗ 𝑟𝑎𝑑𝑖𝑢𝑠 ∗𝑟𝑎𝑑𝑖𝑢𝑠).
Q2.Design three classes Student, Exam and Result. Student class has data members roll_no and
name. Exam class which is derived from Student class has data members representing marks
scored in six subjects. Results which is derived from Exam class has its own data member total
marks. Write a program to model this relationship.
Max Marks: 80 (Q1: 25 Marks, Q2: 35 Marks, Record: 10 Marks, Viva: 10 Marks)
Q1. Create a mysql table employee (empcode int primary key, empname varchar(10), designation
varchar(10)). Write a Java program to read employee details from user and insert it in to the table.
Q2.Write a Java Program to create a class Factorial for computing factorial of number under a user
defined package fact.
Max Marks: 80 (Q1: 25 Marks, Q2: 35 Marks, Record: 10 Marks, Viva: 10 Marks)
Q1. Create a GUI using TextArea, TextField and Button. Delete all occurrences of the TextField
text in the TextArea using Button click.
Q2.Write a Java program to create a class Arithmetic to find the sum of two integers under a user
defined package mypack.
QP CODE: S508FN01
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a program using Swing to accept values in two textboxes and display the results of
mathematical operations in the third text box. Use four buttons add, subtract, multiply, and
divide.
2. Create a class called Matrix which contains a two-dimensional integer array, m, n (order
of the matrix) as data members. Include the following member functions
• To read the matrix
• To display the matrix
• To find the transpose of the matrix.
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
FIFTH SEMESTER BCA PROGRAMME (CBCS)
PRACTICAL EXAMINATION NOVEMBER 2023
Software Lab V
2. Create a class Student with attributes roll no, name, age, and course. If the age of the
student is not between 18 and 25 then generate the user-defined exception
“AgeNotWithinRangeException”. If the name contains numbers or special symbols raise
exception “NameNotValidException”. Define the two exception classes.
QP CODE: S508FN03
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a Java program to accept a number then check whether a given number is even or
odd and display the result in the second textbox.
2. Program to create a package named shapes and define abstract class Shape inside it. The
Shape class should have an abstract method getArea(). Define two subclasses Rectangle
and Circle that extend the Shape class and implement the getArea() method. Create a class
FindArea in a different package and use the Rectangle and Circle classes to find the areas
of a rectangle and a circle.
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
FIFTH SEMESTER BCA PROGRAMME (CBCS)
PRACTICAL EXAMINATION NOVEMBER 2023
Software Lab V
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
2. Create an abstract class called Figure which contains three data members (length, breadth and
height). Include an abstract method to find the area .Figure class also contains concrete
methods to read the data members and to display them. Derive two classes Rectangle and
Triangle from Figure and override area() to find the area of a rectangle and triangle.
QP CODE: S508FN05
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
FIFTH SEMESTER BCA PROGRAMME (CBCS)
PRACTICAL EXAMINATION NOVEMBER 2023
Software Lab V
1. Write a swing program to accept a value in a textbox then reverse that number and display
the result in the second textbox.
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a swing program to accept an integer in a textbox then reverse that number and
display the result in the second textbox?
2. Write a java program that implements a multi-thread application that has three threads. First
thread generates a random integer for every one second. second thread computes square of the
number and prints; third thread gives the value of cube of the number?
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
FIFTH SEMESTER BCA PROGRAMME (CBCS)
PRACTICAL EXAMINATION JUNE 2022
Software Lab V
1. Write an applet program to load an image and display it.
2. Write a java program to read n numbers and race an exception called NegativeException
when you input a negative number?
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a swing program to accept an integer in a textbox then find the sum of digits of that
number and display the result in the second textbox?
Office
empno:
empname:
salary:
getvalue()
Teaching Teaching
Designation Designation
setvalue() setvalue()
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
FIFTH SEMESTER BCA PROGRAMME (CBCS)
PRACTICAL EXAMINATION MARCH 2023
Software Lab V
1. Write a program using swing to accept values in two textboxes and display the results of
mathematical operations in third text box. Use four buttons add, subtract, multiply and
divide.
2. Write a multithreaded program to print odd numbers and even numbers from two different
threads with suitable delay.
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a swing program to accept an integer in a textbox then reverse that number and
display the result in the second textbox?
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
FIFTH SEMESTER BCA PROGRAMME (CBCS)
PRACTICAL EXAMINATION MARCH 2023
Software Lab V
2. Write a java program to read n numbers and race an exception called NegativeException
when you input a negative number?
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a swing program to accept an integer in a textbox then find the factorial of that
number and display the result in the second textbox?
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
Office
empno:
empname:
salary:
getvalue()
Teaching N onTeaching
Designation Designation
setvalue() setvalue()
FIFTH SEMESTER BCA PROGRAMME (CBCS)
PRACTICAL EXAMINATION MARCH 2023
Software Lab V
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
FIFTH SEMESTER BCA PROGRAMME (CBCS)
PRACTICAL EXAMINATION MARCH 2023
Software Lab V
1. Write a swing program to accept an integer in a textbox then find the factorial of that
number and display the result in the second textbox?
2. Write a java program to find the details of the students eligible to enroll for the examination
(Students, Department jointly give the eligibility criteria for the enrollment class) using
interfaces,
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
2. Define class MyDate with members day, month, year. Define default and parameterized
constructors. Accept values from the command line and create a date object. Throw user
defined exceptions – “InvalidDayException” or “InvalidMonthException” if the day and
month are invalid. If the date is valid, display message “Valid date”.
Students
Department
sno: sno:
sname: attendense:
class: getattendanc e()
getvalue()
Exam
calattendanc e()
bool eligible()
QP CODE: S507FN204 Time: 3 Hours
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a program using swing to accept values in two textboxes then find the largest number
and display the result in third text box.
2. Create a package named music and define a class Song inside it. The Song class should
have instance variables title, artist, and duration, and methods play() to play the song, and
displayDetails() to display the song's details. Create another class Music in a different
package and use the Song class to play a song and display its details.
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a swing program to accept a value in a textbox then find the area of a circle and
display the result in the second textbox? (hint : A = πr2 )
QP CODE: S503FN101
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a program using swing to accept values in two textboxes and display the results of
mathematical operations in third text box. Use four buttons add, subtract, multiply and
divide.
2. Create a class called Matrix which contains a two dimensional integer array, m, n (order
of the matrix) as data members. Include the following member functions
• To read the matrix
• To display the matrix
• To find the transpose of the matrix.
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
2. Create a class Student with attributes roll no, name, age and course. If age of student is
not in between 15 and 21 then generate user-defined exception
“AgeNotWithinRangeException”. If name contains numbers or special symbols raise
exception “NameNotValidException”. Define the two exception classes.
QP CODE: S503FN103
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a java program to accept a number then check whether a given number is positive or
negative and display the result in the second textbox?
2. Write a multithreaded program to print odd numbers and even numbers from two different
threads with suitable delay
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
QP CODE: S503FN105
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a swing program to accept a value in a textbox then find the factorial of that number
and display the result in the second textbox?
S504FN205
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
2. Write a program that creates three threads. First thread displays “Good Morning” every one second,
the second thread displays “Hello” every two seconds and the third thread displays “Welcome”
every three seconds.
S504FN201
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a swing program to accept a value in a textbox then find the Volume of a sphere and
display the result in the second textbox? (hint :V = 4/3 πr 3 )
2. Create an abstract class called Figure which contains three data members ( length, breadth
and height). Include an abstract method to find the area .Figure class also contains
concrete methods to read the data members and to display them. Derive two classes
Rectangle and Triangle from Figure and override area() to find the area of a rectangle
and triangle.
3. Write a java application program to print odd and even numbers less than 100 using
multithreading
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a swing program to accept an integer in a textbox then reverse that number and
display the result in the second textbox?
2. Write a java program that implements a multi-thread application that has three threads. First thread
generates a random integer for every one second. second thread computes square of the number and
prints; third thread gives the value of cube of the number?
FIFTH SEMESTER BCA PROGRAMME (CBCSS)
PRACTICAL EXAMINATION MARCH 2021
Software Lab V
2. Write a java program to read n numbers and race an exception called NegativeException
when you input a negative number?
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a swing program to accept an integer in a textbox then find the sum of digits of that
number and display the result in the second textbox?
Office
empno:
empname:
salary:
getvalue()
Teaching Teaching
Designation Designation
setvalue() setvalue()