0% found this document useful (0 votes)
203 views25 pages

T.Y. B.SC Computer Science Core Java Slips 2020 Pattern

This document contains several Java programming questions that could be given as part of a practical examination for a Java programming course. Each question is worth a certain number of marks and tests a different Java concept such as classes, inheritance, interfaces, exceptions, file handling, and more. Students would need to write Java code to solve the problems within the allotted time of 3 hours.

Uploaded by

Anand Bhagwat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
203 views25 pages

T.Y. B.SC Computer Science Core Java Slips 2020 Pattern

This document contains several Java programming questions that could be given as part of a practical examination for a Java programming course. Each question is worth a certain number of marks and tests a different Java concept such as classes, inheritance, interfaces, exceptions, file handling, and more. Students would need to write Java code to solve the problems within the allotted time of 3 hours.

Uploaded by

Anand Bhagwat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 25

Savitribai Phule Pune University

T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)


CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a java program that take input as a person name in the format of first,
middle and last name and then print it in the form last, first and middle name,
where in the middle name first character is capital letter. [15]

Q.2) Write a program to calculate perimeter and area of rectangle.


(hint : area = length * breadth ,perimeter=2*(length+breadth))
[15]

Q.3) Viva (Java) [5]


Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Create an employee class(id,name,deptname,salary). Define a default and


parameterized constructor. Use ‘this’ keyword to initialize instance variables. Keep a
count of objects created. Create objects using parameterized constructor and display
the object count after each object is created.(Use static member and method). Also
display the contents of each object. [15]

Q.2) Write a package for String operation which has two classes Con and Comp. Con
class has to concatenates two strings and comp class compares two strings. Also display
proper message on execution. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Define a class MyData (Day, Month, year) with methods to accept and display a
MyData object Accept data as dd, mm, yyyy. Throw user defined execution
“InvalidDateException” if the data is invalid.
Example of invalid dates: a. 12 15 2015
b. 31 6 1990
c. 29 2 2015 [15]
Q.2) Write a java program that take input as a person name in the format of first, middle and last
name and then print it in the form last, first and middle name, where in the middle name first
character is capital letter. [15]

Q.3) Viva (Java) [5]


Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a java program to display following pattern:


*
**
***
****
***** [15]

Q.2) Write a java Program to accept employee name from a user and display it in reverse order.
[15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a program for multilevel inheritance such that country is inherited from
continent. State is inherited from country. Display the place, state, country and
continent. [15]
Q.2) Define an interface “Operation” which has methods area(),volume().Define a
constant PI having a value 3.142.Create a class cylinder which implements this interface
(members – radius, height) Create one object and calculate the area and volume. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a Java program to calculate factorial of a number using recursion. [15]

Q.2) Write a java program that take input as a person name in the format of first, middle and last
name and then print it in the form last, first and middle name, where in the middle name first
character is capital letter. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a program to read a text file “sample.txt” and display the contents of a file in
reverse order and also original contents change the case (display in upper case). [15]
Q.2) Design a screen to handle the Mouse Events such as MOUSE_MOVED and MOUSE_CLICK
and display the position of the Mouse_Click in a TextField. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Define an Interface Shape with abstract method area(). Write a java program to
calculate an area of Circle and Sphere.(use final keyword) [15]
Q.2) Write a java program to calculate the size of a file. [15]

Q.3) Viva (Java) [5]


Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a java program that works as a simple calculator. Use a grid layout to arrange
buttons for the digits and for the +, -, *, % operations. Add a text field to display the
result.

[15]

Q.2) Write a java program to display at least five records of employee in JTable.( Eno,
Ename,ESal, BOD etc). [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a program to implement a simple arithmetic calculator. Perform appropriate


validations. [15]

Result

1 2 3 +

4 5 6 -

7 8 9 *

0 . = /

Q.2) Design a screen to handle the Mouse Events such as MOUSE_MOVED and
MOUSE_CLICK and display the position of the Mouse_Click in a TextField.
[15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a program to read a text file “sample.txt” and display the contents of a file in
reverse order and also original contents change the case (display in upper case). [15]
Q.2) Define an abstract class Staff with protected members id and name. Define a parameterized
constructor. Define one subclass OfficeStaff with member department. Create n objects of
OfficeStaff and display all details. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a program for multilevel inheritance such that country is inherited from continent.
State is inherited from country. Display the place, state, country and continent.
[15]
Q.2) Create an employee class(id,name,deptname,salary). Define a default and
parameterized constructor. Use ‘this’ keyword to initialize instance variables. Keep
a count of objects created. Create objects using parameterized constructor and
display the object count after each object is created.(Use static member and
method). Also display the contents of each object. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a program to accept n names of country and display them in descending
order. [15]
Q.2) Write a program for multilevel inheritance such that country is inherited from continent.
State is inherited from country. Display the place, state, country and continent. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Define a class MyDate (day, month, year) with methods to accept and display a
MyDate object. Accept date as dd, mm, yyyy. Throw user defined exception
“InvalidDateException” if the date is invalid.
Examples of invalid dates : 03 15 2019, 31 6 2000, 29 2 2021 [15]
Q.2) Create an Applet that displays the x and y position of the cursor movement using Mouse and
Keyboard. (Use appropriate listener). [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write an applet application to display smiley and sad face. [15]
Q.2) Design a screen to handle the Mouse Events such as MOUSE_MOVED and
MOUSE_CLICK and display the position of the Mouse_Click in a TextField. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a java program that works as a simple calculator. Use a grid layout to
arrange buttons for the digits and for the +, -, *, % operations. Add a text field to
display the result.

[15]

Q.2) Write a program to read a text file “sample.txt” and display the contents of a file in reverse
order and also original contents change the case (display in upper case). [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Define an interface “Operation” which has methods area(),volume().Define a


constant PI having a value 3.142.Create a class cylinder which implements this
interface (members – radius, height) Create one object and calculate the area and
volume. [15]
Q.2) Write a package for String operation which has two classes Con and Comp. Con
class has to concatenates two strings and comp class compares two strings. Also display
proper message on execution. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a java program that take input as a person name in the format of first,
middle and last name and then print it in the form last, first and middle name, where
in the middle name first character is capital letter. [15]
Q.2) Write a program to accept n names of country and display them in descending order. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a program to calculate perimeter and area of rectangle. (hint : area = length *
breadth , perimeter=2*(length+breadth)). [15]
Q.2) Define an abstract class Staff with protected members id and name. Define a
parameterized constructor. Define one subclass OfficeStaff with member department.
Create n objects of OfficeStaff and display all details. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a java program to display following pattern:


*
**
***
****
***** [15]

Q.2) Define an interface “Operation” which has methods area(),volume().Define a


constant PI having a value 3.142.Create a class cylinder which implements this interface
(members – radius, height) Create one object and calculate the area and volume.
[15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Define Student class (roll number, name, percentage). Define a default and
parameterized constructor. Keep a count of object created. Create objects using
parameterized constructor and display the object count after each object is created.
(Use static member and method). Also display the contents of each object. Modify
program to create “n” objects of the Student class. Accept details for each object.
Define static method “sortStudent” which sorts the array on the basis of percentage.
[15]
Q.2) Write a program to read a text file “sample.txt” and display the contents of a
file in reverse order and also original contents change the case (display in upper
case). [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a program to read a text file “sample.txt” and display the contents of a file in
reverse order and also original contents change the case (display in upper case). [15]
Q.2) Write a Java program to design a screen using Awt that will take a user name
and password. If the user name and password are not same, raise an Exception with
appropriate message. User can have 3 login chances only. Use clear button to clear
the TextFields. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Write a package for String operation which has two classes Con and Comp. Con
class has to concatenates two strings and comp class compares two strings. Also
display proper message on execution. [15]
Q.2) Write an applet application to display smiley and sad face. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Define class EmailId with members ,username and password. Define default
parameterized constructors. Accept values from the command line Throw user defined
exceptions – “InvalidUsernameException” or “InvalidPasswordException” if the
username and password are invalid. [15]
Q.2) Write a program to using marker interface create a class product(product_id,
product_name, product_cost, product_quantity) define a default and parameterized
constructor. Create objects of class product and display the contents of each object
and Also display the object count. [15]
Q.3) Viva (Java) [5]
Savitribai Phule Pune University
T.Y.B.Sc. (Computer Science) Practical Examination (2019 Pattern)
CS – 359 Lab Course – Programming in Java – I Year 2021-22

Duration : 3 Hours Maximum Marks : 35

Q.1) Design a screen to handle the Mouse Events such as MOUSE_MOVED and
MOUSE_CLICK and display the position of the Mouse_Click in a TextField.[15

Q.2) Write a Java program to design a screen using Awt that will take a user name
and password. If the user name and password are not same, raise an Exception with
appropriate message. User can have 3 login chances only. Use clear button to clear
the TextFields. [15]
Q.3) Viva (Java) [5]

You might also like