0% found this document useful (0 votes)
6K views30 pages

TYBBA (CA) Sem V Practical Slips

This document contains instructions for a university practical examination in a computer laboratory course. It includes the following: 1) There are 4 questions worth a total of 100 marks. Question 1 involves Core Java programs, Question 2 involves either MongoDB queries or Python programs, Question 3 is an oral exam, and Question 4 involves submitting a lab book. 2) For Question 1, students must write Java programs to display characters or copy file content. 3) For Question 2 using MongoDB, students must create document collections, perform queries on the collections involving films or competitions data, and perform CRUD operations. Alternatively for Python, students write functions on lists or create a GUI clock program. 4) Question 3 is an oral

Uploaded by

Surinder Jaat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6K views30 pages

TYBBA (CA) Sem V Practical Slips

This document contains instructions for a university practical examination in a computer laboratory course. It includes the following: 1) There are 4 questions worth a total of 100 marks. Question 1 involves Core Java programs, Question 2 involves either MongoDB queries or Python programs, Question 3 is an oral exam, and Question 4 involves submitting a lab book. 2) For Question 1, students must write Java programs to display characters or copy file content. 3) For Question 2 using MongoDB, students must create document collections, perform queries on the collections involving films or competitions data, and perform CRUD operations. Alternatively for Python, students write functions on lists or create a GUI clock program. 4) Question 3 is an oral

Uploaded by

Surinder Jaat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Savitribai Phule Pune University

T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination


Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a ‘java’ program to display characters from ‘A’ to ‘Z’. [15 M]
B) Write a ‘java’ program to copy only non-numeric data from one file to another file.
[25 M]
Q.2. MongoDB:
A) Create a ‘films’ collection of documents with the following fields: [15 M]
{
title : "Jurassic Park",
director : "Steven Spielberg",
release_year : 1993,
language:"English",
film_type : [ "Action", "Adventure "],
actors : ["Sam Neill", "Laura Dern", "Jeff Goldblum"]
}
1) Insert at least 10 documents in a collection.
2) Display all documents of ‘films’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Give all English films released before year 2000.
2) Display title and release year of ‘Action’ films that starts with the letter ‘K’.
3) Display the latest five ‘Hindi’ films released in easy-to-read format.
4) Count the number of films in which ‘Akshay Kumar’ has not acted.
5) Update release year of a film ‘Jungle Book’ to 2016.

OR

Q.2 Python:
A) Write a Python program to accept n numbers in list and remove duplicates from a
list. [15 M]
B) Write Python GUI program to take accept your birthdate and output your age when a
button is pressed. [25 M]

Q.3 Viva [10 M]

Q.4 Lab Book [10 M]

1
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


1. A) Write a java program to display all the vowels from a given string. [15 M]
B) Design a screen in Java to handle the Mouse Events such as MOUSE_MOVED and
MOUSE_CLICK and display the position of the Mouse_Click in a TextField.
[25 M]

Q.2. MongoDB:
A) Create a ‘Competition’ collection of documents with the following fields: [15 M]
{Competition_Name: "….", Competition_Type: "….", Competition_Year:…,
students:["….", "….","…." ]}
In this, Competition_type can be ‘Sport’ or ‘Academic’.
1) Insert at least 10 documents in a collection.
2) Display all documents of ‘Competition’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Display all ‘Sport’ competition details which were held between years 2018 to
2019.
2) Display number of students participated in ‘Running’ competition which was
conducted in year 2019.
3) Update Competition_name of ‘Programming Competition’ to ‘Online Programming
Competition’ for year 2020.
4) Add one more name of student ‘Prasad More’ in ‘Project Competition’ of year
2021.
5) Sort Competition collection in descending order of Competition_Year.

OR
Q.2 Python:
A) Write a Python function that accepts a string and calculate the number of upper case
letters and lower case letters.
Sample String: 'The quick Brown Fox'
Expected Output:
No. of Upper case characters: 3
No. of Lower case characters: 13 [15 M]

B) Write Python GUI program to create a digital clock with Tkinter to display the time.
[25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

2
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a ‘java’ program to check whether given number is Armstrong or not.
(Use static keyword) [15 M]
B) Define an abstract class Shape with abstract methods area () and volume (). Derive
abstract class Shape into two classes Cone and Cylinder. Write a java Program
to calculate area and volume of Cone and Cylinder.(Use Super Keyword.)
[25 M]

Q.2. MongoDB:
A) Create a ‘Hospital’ collection of documents with the following fields: [15 M]
{ hospital_name:"Birla Hospital",
city: “Chinchwad”,
specialties:["Pediatric", "Orthopedic"],
doctors:[{doctor_name:"Dr. Kadam", visit_day:"Monday"}, {doctor_name:"Dr.
Mane", visit_day:"Tuesday"}],
services:["laboratory", "surgical", "diagnostic", "ambulance"],
rating:5
}
1) Insert at least 10 documents in a collection.
2) Display all documents of ‘Hospital’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Display details of hospital where Dr. More is visiting.
2) Display all hospital names along with their specialties from ‘Pune’ city.
3) Count the number of hospitals which are providing ‘ambulance’ service.
4) Display details of hospital whose ‘rating’ is specified.
5) Delete those documents whose hospital name starts with letter ‘P’.

OR
Q.2 Python:
A) Write a Python program to check if a given key already exists in a dictionary. If
key exists replace with another key/value pair. [15 M]
B) Write a python script to define a class student having members roll no, name, age,
gender. Create a subclass called Test with member marks of 3 subjects. Create three
objects of the Test class and display all the details of the student with total marks.
[25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

3
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to display alternate character from a given string.[15 M]
B) Write a java program using Applet to implement a simple arithmetic calculator.

[25 M]

Q.2. MongoDB:
A) Create a ‘Book’ collection of documents with the following fields: [15 M]
{
Book_Title:"….", Publisher_name:"….", Authors:[".....","......"],
Language:"….",Publication_year:….,ISBN:…., price:…..
}
1) Insert at least 10 documents in a collection, use bulk insert.
2) Display all documents of ‘Book’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Display two books of ‘BPB’ publication.
2) Display Book_title and Authors of books published between years 2019 to 2021.
3) Count number of books having three authors.
4) Update the ISBN number of book titled “Definitive Guide to MongoDB” to “1-
4302-3051-7”.
5) Add one more author “Alex Buckley” to book titled “The Java Languages
Specification”.
OR
Q.2 Python:
A) Write Python GUI program to create background with changing colors [15 M]
B) Define a class Employee having members id, name, department, salary. Create a
subclass called manager with member bonus. Define methods accept and display in
both the classes. Create n objects of the manager class and display the details of the
manager having the maximum total salary (salary+bonus). [25 M]

Q.3 Viva [10 M]

Q.4 Lab Book [10 M]

4
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to display following pattern:
5
45
345
2345
12345 [15 M]
B) Write a java program to accept list of file names through command line. Delete the
files having extension .txt. Display name, location and size of remaining files.
[25 M]

Q.2. MongoDB:
A) Create an ‘Institute’ collection of documents with the following fields: [15 M]
{ Name:"….", City:"….",No_of_faculties:….,Est_Year:….,
Courses:[{Course_Name:"….", Dur_in_month:….,Fees:….},…]
}
1) Insert at least 10 documents in a collection.
2) Display all documents of ‘Institute’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Give all institute names whose establishment year is before2010.
2) Display Institute details having Course ‘Java’.
3) Update No_of_faculties of ‘Disha’ Institute to 10.
4) Display the latest three Institutes established in easy-to-read format.
5) Count the number of Institutes in ‘Pune’ city, established after 2019.

OR

Q.2 Python:
A) Write a Python script using class, which has two methods get_String and
print_String. get_String accept a string from the user and print_String print the string in
upper case. [15 M]

B) Write a python script to generate Fibonacci terms using generator function.


[25 M]

Q.3 Viva [10 M]

Q.4 Lab Book [10 M]

5
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to accept a number from user, if it zero then throw user
defined Exception “Number Is Zero”, otherwise calculate the sum of first and last digit
of that number. (Use static keyword). [15 M]
B) Write a java program to display transpose of a given matrix. [25 M]

Q.2. MongoDB:
A) Create a ‘Doctor’ collection of documents with the following fields: [15 M]
{
Doctor_name:"Dr. Patil",
Contact_No:9876543210,
City: “Pune”,
Qualification:"MBBS",
specialization:["ENT", "General Surgery"],
hospitals:[{hospital_name:"Niramay Hospital", visit_day:"Monday"},
{hospital_name:"Birla Hospital", visit_day:"Tuesday"}]
}
1) Insert at least 10 documents in a collection, use bulk insert.
2) Display all documents of ‘Doctor’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Count number of doctors having qualification ‘MBBS’.
2) Display qualification and specialization of all doctors from ‘Mumbai’ city.
3) Display details of two doctors having specialization in ‘ENT’.
4) Change qualification of “Dr. Patil” to MD.
5) Delete all Doctor Documents not having city ‘Pimpri’.

OR

Q.2 Python:
A) Write python script using package to calculate area and volume of cube and sphere
[15 M]
B) Write a Python GUI program to create a label and change the label font style (font
name, bold, size). Specify separate check button for each style. [25 M]

Q.3 Viva [10 M]

Q.4 Lab Book [10 M]

6
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to display Label with text “Dr. D Y Patil College”,
background color Red and font size 20 on the frame. [15 M]
B) Write a java program to accept details of ‘n’ cricket player (pid, pname, totalRuns,
InningsPlayed, NotOuttimes). Calculate the average of all the players. Display the
details of player having maximum average. (Use Array of Object) [25 M]

Q.2. MongoDB:
A. Create a ‘Result’ collection of documents with the following fields: [15 M]
{
student_id:1,
student_name:"Mr. Anuj Joshi",
class:"TYBBA_CA",
test_marks:[{subject:"Java",marks:78},{subject:"Python",marks:80}],
grade: ‘A’
}
1) Insert at least 10 documents in a collection.
2) Display all documents of ‘Result’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Display details of students whose ‘grade’ is given.
2) Display documents where the subject is ‘Java’ and marks are greater than or equal
to 70.
3) Display student details whose name ends with “ne”.
4) Give name and class of student who has given 4 subject tests.
5) Insert a field percentage in student document whose name is “Ms. Priya Rane”
OR
Q.2 Python:
A) Write Python class to perform addition of two complex numbers using binary +
operator overloading. [15 M]
B) Write python GUI program to generate a random password with upper and lower
case letters. [25 M]

Q.3 Viva [10 M]

Q.4 Lab Book [10 M]

7
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Define an Interface Shape with abstract method area(). Write a java program to
calculate an area of Circle and Sphere.(use final keyword) [15 M]
B) Write a java program to display the files having extension .txt from a given
directory. [25 M]

Q.2. MongoDB:
A) Create an ‘Album’ collection of documents with the following fields: [15 M]
{title:"….",artist: ["….","…."],released_year: ….,
tracks:[{track_id: …., track_title:"….",seconds: …. },…..],genre: "…."}
1) Insert at least 10 documents in a collection, use bulk insert.
2) Display all documents of ‘Album’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Count number of albums released between years 2010 to 2020.
2) Display two documents which have genre ‘Rock’.
3) Give title and artist of an album which has 3 tracks.
4) Display albums that do not have genre either ‘Rock’ or ‘hip-hop’.
5) Update the seconds of the track to 6.38 whose track id is 2 and album title is
“What’s Going On”.

OR

Q.2 Python:
A) Write a python script to find the repeated items of a tuple [15 M]
B) Write a Python class which has two methods get_String and print_String. get_String
accept a string from the user and print_String print the string in upper case. Further
modify the program to reverse a string word by word and print it in lower case.
[25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

8
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java Program to display following pattern:
1
01
010
1010 [15 M]

B) Write a java program to validate PAN number and Mobile Number. If it is invalid
then throw user defined Exception “Invalid Data”, otherwise display it. [25 M]

Q.2. MongoDB:
A) Create a ‘Contributor’ collection of documents with the following fields:[15 M]
{ Contributor_name: "Rohit Sawant",
Branch:"CSE",
Join_year:2019,
Language:["C++", "Java"],
Articles:[{Language:"C++",tArticles:20,pArticles:30},{Language:"Java",tArticl
es:50,pArticles:30}],
Personal_Info: {age:24, Sem_Marks:[70, 80, 77, 81]}
}
1) Insert at least 10 documents in a collection.
2) Display all documents of ‘Contributor’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Append two languages named “Python” and “C” to contributor “Rohit Sawant”.
2) Delete the first matched document having Branch “CSE” or Join_Year less than
2020.
3) Display the latest five Contributors joined in easy-to-read format.
4) Display documents having “CSE” branch. (Use cursor)
5) Give the name and branch of contributor whose age is greater than or equal to 20.

OR
Q.2 Python:
A) Write a Python script using class to reverse a string word by word [15 M]

B) Write Python GUI program to accept a number n and check whether it is Prime,
Perfect or Armstrong number or not. Specify three radio buttons. [25 M]

Q.3 Viva [10 M]

Q.4 Lab Book [10 M]

9
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to count the frequency of each character in a given string.
[15 M]
B) Write a java program for the following:

[25 M]

Q.2. MongoDB:
A) Create a ‘Person’ collection of documents with the following fields: [15 M]
{pname: "….", contact_no: …. , city: "….", profession: ["….","…."],
cars:[{model: "….", year: ….,price: …. }, …. ]}
1) Insert at least 10 documents in a collection, use bulk insert.
2) Display all documents of ‘Person’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Display the name and contact number of person having 3 cars.
2) Display different cities from which persons belong.
3) Create an index using the ‘pname’ field and name it as ‘Person Name Index’.
4) Delete the first person document whose city is ‘Chinchwad’.
5) Update Person document whose name is “Mrs. Mahajan” while updating add only
those professions which are not already exists in her profession field.

OR
Q.2 Python:
A) Write Python GUI program to display an alert message when a button is pressed.
[15 M]

B) Write a Python class to find validity of a string of parentheses, '(', ')', '{', '}', '[' ']’.
These brackets must be close in the correct order. for example "()" and "()[]{}" are
valid but "[)", "({[)]" and "{{{" are invalid. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

10
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a menu driven java program using command line arguments for the
following: [15 M]
1. Addition
2. Subtraction
3. Multiplication
4. Division.
B) Write an applet application to display Table lamp. The color of lamp should get
change randomly. [25 M]

Q.2. MongoDB:
A) Create a ‘Company’ collection of documents with the following fields: [15 M]
{ company_id:1,
company_name:"Apple",
contact_details:{ address: "Cupertino, CA 95014", phone: "1-408-996-1010"},
products:[{code: "A-123", name:"IPhone 7", price: 29,900},{code: "A-456",
name: "IPadPro", price: 37,900}],
rating:5
}
1) Insert at least 10 documents in a collection.
2) Display all documents of ‘Company’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Count number of mobile companies whose name ends with letter ‘o’.
2) Sort the company collection in descending order of their id.
3) Give address and phone number of ‘Samsung’ company.
4) Update the price of the ‘IPhone 7’ to 32,900.
5) Display details of company whose ‘rating’ is specified.

OR
Q.2 Python:
A) Write a Python program to compute element-wise sum of given tuples.
Original lists: (1, 2, 3, 4) (3, 5, 2, 1) (2, 2, 3, 1)
Element-wise sum of the said tuples: (6, 9, 8, 6) [15 M]
B) Write Python GUI program to add menu bar with name of colors as options to
change the background color as per selection from menu option. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

11
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to display each String in reverse order from a String array.
[15 M]
B) Write a java program to display multiplication table of a given number into the List
box by clicking on button. [25 M]

Q.2. MongoDB:
A) Create a ‘Customer’ collection of documents with the following fields: [15 M]
{ Cust_id: 1,
Cust_name: "Mr. Joshi",
address:{city: "Pune", street: "S. B. Road"},
orders: [
{ id:101,
orderItems:[
{ productId: 8, price: 560,
productName: "keyboard"
},…..],
},…..]
}
1) Insert at least 10 documents in a collection.
2) Display all documents of ‘Customer’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Display customer details that have placed two orders.
2) Replace the document having id 3 with a new document.
3) Increment the price of ‘keyboard’ by Rs. 100.
4) Add one more product in an order having order id 101, which is placed by “Mr.
Joshi”.
5) Display all the documents having customer id greater than or equal to 4. (Use
cursor)
OR
Q.2 Python:
A) Write a Python GUI program to create a label and change the label font style (font
name, bold, size) using tkinter module. [15 M]
B) Write a python program to count repeated characters in a string.
Sample string: 'thequickbrownfoxjumpsoverthelazydog'
Expected output: o-4, e-3, u-2, h-2, r-2, t-2 [25 M]
Q.3 Viva [10 M]
Q.4 Lab Book [10 M]

12
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to accept ‘n’ integers from the user & store them in an
ArrayList collection. Display the elements of ArrayList collection in reverse order.
[15 M]

B) Write a java program that asks the user name, and then greets the user by name.
Before outputting the user's name, convert it to upper case letters. For example, if
the user's name is Raj, then the program should respond "Hello, RAJ, nice to meet
you!". [25 M]

Q.2. MongoDB:
A) Create a ‘Student’ collection of documents with the following fields: [15 M]
{ rno: …., class: "….",
fname: "….", lname: "….",
age: …., address:{street: "….", city: "….", state: "…."},
hobbies: ["….","…."]
}
1) Insert at least 10 documents in a collection, use bulk insert.
2) Display all documents of ‘Student’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Display the total number of students in ‘TYBBA_CA’ class.
2) Give rno, fname and lname of student who is having smallest age in class
‘SYBBA_CA’.
3) Add one more hobby ‘swimming’ at second position in the hobbies field of student
having roll number 2 and class ‘TYBBA_CA’.
4) Rename the name of ‘fname’ field to ‘firstname’ and ‘lname’ to ‘lastname’ in all the
student documents having age greater than or equal to 18.
5) Insert a new field ‘percentage’ in the student document having class ‘TYBBA_CA’
and roll number 1.
OR

Q.2 Python:
A) Write a Python program to input a positive integer. Display correct message for
correct and incorrect input. (Use Exception Handling) [15 M]
B) Write a program to implement the concept of queue using list. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

13
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a Java program to calculate power of a number using recursion.
[15 M]
B) Write a java program to accept the details of employee (Eno, EName, Sal) and
display it on next frame using appropriate event . [25 M]

Q.2. MongoDB:
A) Create a ‘Musicians’ collection of documents with the following fields: [15 M]
{ id: ….,
name: "….",
birth_year: ….,
albums: ["….","…."],
instruments: ["….","…."]
}
1) Insert at least 10 documents in a collection, use bulk insert.
2) Display all documents of ‘Musicians’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Display the name of musicians in descending order of their birth year.
2) Add one more album to the musician having id 3.
3) Insert a new field ‘occupations’ in the musician document having name ‘A. R.
Rahman’.
4) Give id and name of only those musicians who plays 2 instruments.
5) Update the birth year of the musician “Pandit Ravi Shankar” to 1920.

OR

Q.2 Python:
A) Write a Python GUI program to accept dimensions of a cylinder and display the
surface area and volume of cylinder. [15 M]

B) Write a Python program to display plain text and cipher text using a Caesar
encryption. [25 M]

Q.3 Viva [10 M]

Q.4 Lab Book [10 M]

14
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to search given name into the array, if it is found then display
its index otherwise display appropriate message. [15 M]
B) Write an applet application to display smiley face. [25 M]

Q.2. MongoDB:
A) Create a ‘Projects’ collection of documents with the following fields: [15 M]
{ proj_id: ….,
proj_name: "….",
proj_manager: "….",
start_date: ….,
dur_in_month: ….,
emps_work_in_proj: ["….","…."]
}
1) Insert at least 10 documents in a collection.
2) Display all documents of ‘Projects’ collection in proper format.

B) Solve the Following Queries: [25 M]


1) Display id and name of all those projects having duration greater than or equal to six
months.
2) Count number of projects managed by “Mr. Sumit Jadhav”.
3) Increment the duration of all projects by one month.
4) Add one more employee “Mr. Mahesh Kulkarni” to the “College Automation” project.
5) Display details of projects in which 4 employees are working.

OR

Q.2 Python:
A) Write a Python class named Student with two attributes student_name, marks.
Modify the attribute values of the said class and print the original and modified values
of the said attributes. [15 M]

B) Write a python program to accept string and remove the characters which have odd
index values of given string using user defined function. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

15
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to calculate sum of digits of a given number using recursion.
[15 M]
B) Write a java program to accept n employee names from user. Sort them in
ascending order and Display them.(Use array of object and Static keyword)
[25 M]
Q.2. MongoDB:
A) Create two documents named user1 and user2 as follows: [15 M]
1) user1 = {FName: "Test", LName: "User", Age:30, Gender: "M", Country: "India”}
user2 = {Name: "Test User", Age:45, Gender: "F", Country: "India”}
add both these documents (user1 and user2) to the users collection in the subsequent
order.
2) Verify your created collection and database by using proper Mongo DB command

B) Solve the Following Queries: [25 M]


1) Display all documents in the users collection.
2) Updates the country to UK for all female users and check whether the country has
been updated for all the female employees or not.
3) Add new field company to all the documents.
4) Delete the documents where Gender = ‘M’ .
5) Add 5 more similar documents in a collection and find all female users who belongs
to either India or US.

OR

Q.2 Python:
A) Write a python script to create a class Rectangle with data member’s length, width
and methods area, perimeter which can compute the area and perimeter of rectangle.
[15 M]

B) Write Python GUI program to add items in listbox widget and to print and delete the
selected items from listbox on button click. Provide three separate buttons to add, print
and delete. [25 M]

Q.3 Viva [10 M]

Q.4 Lab Book [10 M]

16
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java Program to accept ‘n’ no’s through command line and store only
armstrong no’s into the array and display that array. [15 M]

B) Define a class Product (pid, pname, price, qty). Write a function to accept the product
details, display it and calculate total amount. (use array of Objects) [25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create document named scientist with following fields:
2) {First Name: , Last Name: , Contribution: , Awarded: ,
date _of_birth: , Year : , Country: } in a collection.
The document keeps information about the scientist who has contributed in various
fields like Artificial intelligence, Data Science etc. The scientist may have contributed in
more than one field and may have received more than one awards for his contribution
in various fields.
2) Insert at least 10 documents in a collection.
B) Solve the Following Queries: [25 M]
1) List names of all scientists whose last name starts with N.
2) List all scientists who were born after 1/1/1960.
3) List scientists that received an award in year 2000.
4) List all scientists who have received “Turing Machine Award”
5) List all scientist who has made contributed in4fields

OR

Q.2 Python:
A) Write Python GUI program that takes input string and change letter to upper case
when a button is pressed. [15 M]
B) Define a class Date (Day, Month, Year) with functions to accept and display it.
Accept date from user. Throw user defined exception “invalid Date Exception” if the
date is invalid. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

17
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a Java program to calculate area of Circle, Triangle & Rectangle.(Use Method
Overloading) [15 M]
B) Write a java program to copy the data from one file into another file, while copying
change the case of characters in target file and replaces all digits by ‘*’ symbol.
[25 M]

Q.2. MongoDB:
A) Solve the following : [15 M]
1) Create documents Inventory with following fields:
{Item Name: , status: , Tags: , qty: }
2) Insert at least 10 documents in a collection with suitable values. Verify created
documents.
B) Solve the Following Queries: [25 M]
1) List all items from the inventory where the status equals "D" and qty is greater
than30.
2) List all items which have 3 tags.
3) List all items having status equal to “A” or having quantity less than 30 and height
of the product should be greaterthan10
4) Delete the documents where status = ‘C’
5) Find all documents that keeps item “Planner” and having in stock quantity
lessthan20

OR

Q.2 Python:
A) Create a list a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] and write a python program that
prints out all the elements of the list that are less than 5 [15 M]

B) Write a python script to define the class person having members name, address.
Create a subclass called Employee with members staffed salary. Create 'n' objects of the
Employee class and display all the details of the employee. 25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

18
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a Java program to display Fibonacci series using function. [15 M]
B) Create an Applet that displays the x and y position of the cursor movement
using Mouse and Keyboard. (Use appropriate listener) [25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create documents containing transaction information as:
{Transaction_id: Customer Name: , Payment_mode: ,
Amount: Date: } in which the payment was done – Cash, Credit Card or
DebitCard in a collection. Verify your created collection and documents by using
proper command.
2) Insert at least 10 documents in a collection.

B) Solve the Following Queries: [25 M]


1) Find all transactions which were made by the user “Vikas”.
2) Find all the transactions which were made using debit card.
3) Find transaction id and total amount of purchase made using a credit card.
4) Find the total payment for each payment type.
5) List all transactions made by customers on particular date.

OR

Q.2 Python:
A) Write a Python GUI program to accept a number form user and display its
multiplication table on button click. [15 M]

B) Define a class named Shape and its subclass(Square/ Circle). The subclass has an
init function which takes an argument (Lenght/redious). Both classes should have
methods to calculate area and volume of a given shape. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

19
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program using AWT to create a Frame with title “TYBBACA”,
background color RED. If user clicks on close button then frame should close.
[15 M]

B) Construct a Linked List containing name: CPP, Java, Python and PHP. Then
extend your java program to do the following:
i. Display the contents of the List using an Iterator
ii. Display the contents of the List in reverse order using a ListIterator.
[25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create documents for Online Mobile Shopping information in a collection as follows:
{CustomerName: Model: ,Brand: , Price: ,RAM_Size:
, Internal_Memory: Ratings_by_customer: }
Verify your created collection and documents by using proper command.
2) Insert at least 10 documents in a collection.

B) Solve the Following Queries: [25 M]


1) List the mobiles having RAM and ROM as 3GB and 32GB.
2) List the customers who bought Samsung J6.
3) List the names of the distinct brands purchased by customer.
4) Display the name of the brand with highest rating.
5) List all the customers in ascending order who bought iphone 7 plus

OR
Q.2 Python:
A) Write a python program to create a class Circle and Compute the Area and the
circumferences of the circle.(use parameterized constructor) [15 M]
B) Write a Python script to generate and print a dictionary which contains a number
(between 1 and n) in the form(x,x*x).
Sample Dictionary (n=5) Expected Output: {1:1, 2:4, 3:9, 4:16, 5:25} [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

20
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to display each word from a file in reverse order. [15 M]
B) Create a hashtable containing city name & STD code. Display the details of the
hashtable. Also search for a specific city and display STD code of that city.
[25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create collection called “marketing” which stores data about a marketing campaign
of a retail business. A document in this collection includes the following pieces of
information.
{_id : , Age : , Gender : ,OwnHome : , Married :
, Location : , Salary : , Children : ,History :
"High/Low", Catalogs : ,AmountSpent : }
Verify your created collection and document by using proper command.
2) Insert at least 10 documents in a collection and verify inserted document.

B) Solve the Following Queries: [25 M]


1) Display first 3 documents in the collection.
2) Find out the average spent amount by customers who received more than 10
catalogs.
3) Find average spent amount by customers who received more than 10 catalogs for
different age groups separately.
4) Calculate the average salary and the total spent amount for customers who have at
least 1 child.
5) Display the salary and spent amount fields of the first 5 documents.

OR
Q.2 Python:
A) Define a class named Rectangle which can be constructed by a length and width.
The Rectangle class has a method which can compute the area and Perimeter.
[15 M]
B) Write a Python program to convert a tuple of string values to a tuple of integer
values. Original tuple values: (('333', '33'), ('1416', '55'))
New tuple values: ((333, 33), (1416, 55)) [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

21
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a Java program to calculate factorial of a number using recursion.
[15 M]
B) Write a java program for the following: [25 M]
1. To create a file.
2. To rename a file.
3. To delete a file.
4. To display path of a file.

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create two documents named emp1 and emp2 as follows:
emp1 = {Empid: , EmpName: , Department: , Salary: }
emp2 = {Empid: , Age: , Address: }
add both these documents ( emp1 and emp2) to the Employee collection in the
subsequent order.
2) Verify your created collection and database by using proper command.

B) Solve the Following Queries: [25 M]


1) Display all documents in the Employee collection.
2) Updates the department to Marketing for all employees having salary greater than
20000 and less than 30000.
3) Add new field company to all the documents.
4) Delete the documents where Age > 60 .
5) Add 5 more similar documents in a collection and find all employees who lives in
Pune and age less than 25.

OR
Q.2 Python:
A) Write a python class to accept a string and number n from user and display n
repetition of strings by overloading * operator. [15 M]

B) Write a python script to implement bubble sort using list [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

22
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to check whether given file is hidden or not. If not then
display its path, otherwise display appropriate message. [15 M]

B) Write a java program to design following Frame using Swing. [25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create document to grocery store as follows:
{item_id: , Batch_no: , Item_name: , Price: , Weight:
, Category: , items_in stock: }
in “departmental_store” collection.
2) Insert at least 10 documents in a collection with suitable values. Verify created
documents.
B) Solve the Following Queries: [25 M]
1) Display all documents in the “departmental_store” collection with batch no B1001.
2) Updates the Price of items for items having batch B1002
3) Display all items that comes in grain category.
4) Delete the items which stock is 0
5) Sort all items by their Batch_nos.

OR
Q.2 Python:
A) Write a Python GUI program to create a label and change the label font style (font
name, bold, size) using tkinter module. [15 M]
B) Create a class circles having members radius. Use operator overloading to add the
radius of two circle objects. Also display the area of circle. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

23
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to count number of digits, spaces and characters from a file.
[15 M]

B) Create a package TYBBACA with two classes as class Student (Rno, SName, Per)
with a method disp() to display details of N Students and class Teacher (TID, TName,
Subject) with a method disp() to display the details of teacher who is teaching Java
subject. (Make use of finalize() method and array of Object) [25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create a database named ‘College’. Create collection named ‘Commerce’ in it. This
collection should contain a document. Inside this document, we have a field named
‘Teacher_id’, ‘Teacher_Name’,‘Address’, ‘Salary’. Each document contains another
document with three fields(Specialization, Qualification, Experience) with their one
or more values.
Verify your created collection and database by using proper command.
2) Insert at least 10 documents in a collection with suitable values.

B) Solve the Following Queries: [25 M]


1) Display all documents in created collection.
2) Display all teachers having more than 10 years of experience.
3) Add new field College_Name to all documents.
4) List all teachers having specialization in ‘Accounting’ subject.
5) Increment salary of all teachers having experience more than 10 years by Rs.5000.

OR

Q.2 Python:
A) Write a Python Program to Check if given number is prime or not. Also find
factorial of the given no using user defined function. [15 M]

B) Write Python GUI program which accepts a number n to displays each digit of
number in words. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

24
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to check whether given string is palindrome or not.
[15 M]
B) Create a package named Series having three different classes to print series:
i. Fibonacci series
ii. Cube of numbers
iii. Square of numbers
Write a java program to generate ‘n’ terms of the above series. [25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Created database TV Network containing a collection of products with multiple
documents having fields {“product_id” : ,"product_name": ,"company":, "type":
,"price":, "warranty_years":, "available": "true"},
2) Insert at least 10 documents in a collection with suitable values. Verify your created
collection and database by using proper command.
B) Solve the Following Queries: [25 M]
1) Check if the cursor object has more documents to return or not.
2) Return the next document in a cursor.
3) Insert a new document having, product_name = “Tata sky", "type" : "tv",
"monthly_price" : 250, "term_years" : 2, "cancel_penalty" : 25, "sales_tax" : "true",
"additional_tariffs" : [ { "kind" : "federal tariff", "amount" : { "percent_of_service"
: 0.06 } }, { "kind" : "misc. tariff", "amount" : 2.25}]
4) sort all the documents present in the products collection in descending order.
5) Find how many documents are present in a collection.

OR
Q.2 Python:
A) Write a Python function that accepts a string and calculate the number of upper case
letters and lower case letters.
Sample String : 'The quick Brow Fox'
Expected Output :
No. of Upper case characters : 3
No. of Lower case Characters : 12 [15 M]
B) Write a Python script to Create a Class which Performs Basic Calculator Operations.
[25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

25
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to display ASCII values of the characters from a file.
[15 M]

B) Write a java program using applet to draw Temple. [25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create Programmer collection with documents containing fields
{Programmer_name: ,Join_year: , Languages:[……, ……..,
………], Programmer_details: {age: , "Address":[…., ……..]}};
2) Insert at least 10 documents in a collection with suitable values. Verify your created
collection and database by using proper command.

B) Solve the Following Queries: [25 M]


1) Append a single value, i.e., “C” to an array field, i.e., Language field in the
document whose Programmer_name is “Neha”.
2) Remove the first element of the Language field in the document whose
programmer_name is “Rahul”.
3) Removing the last element of the Language field in the document whose
Programmer_name is “Rahul”.
4) Adds “PHP” in the Language field for the programmer Radha.
5) Delete the first document containing programmer name ‘Radha’.

OR

Q.2 Python:
A) Write an anonymous function to find area of square and rectangle. [15 M]
B) Write Python GUI program which accepts a sentence from the user and alters it
when a button is pressed. Every space should be replaced by *, case of all alphabets
should be reversed, digits are replaced by?. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

26
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to accept a number from user, If it is greater than 1000 then
throw user defined exception “Number is out of Range” otherwise display the factors of
that number. (Use static keyword) [15 M]

B) Write a java program to accept directory name in TextField and display list of files
and subdirectories in List Control from that directory by clicking on Button.
[25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create documents with following data in a collection:
{ _id: ,vidio_title: ,description: , YouTuber Name:, url:,
tags: ['mongodb', 'database', 'NoSQL'], likes: 100 }
2) Insert at least 7 documents in a collection with suitable values. Verify your created
collection and database by using proper command.

B) Solve the Following Queries: [25 M]


1) Display a list stating how many videos are uploaded by each youtuber.
2) Gets the maximum likes of the corresponding values from all documents in the
collection for each youtuber.
3) Calculates the average likes of all given values from all documents in the collection
for each youtuber.
4) Find total likes received to each youtuber.
5) Calculate total likes received to youtuber except “Mongo DB” video.

OR

Q.2 Python:
A) Write a Python program to unzip a list of tuples into individual lists. [15 M]
B) Write Python GUI program to accept a decimal number and convert and display it to
binary, octal and hexadecimal number. [25 M]

Q.3 Viva [10 M]

Q.4 Lab Book [10 M]

27
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to count the number of integers from a given list. (Use
Command line arguments). [15 M]

B) Write a java Program to accept the details of 5 employees (Eno, Ename, Salary) and
display it onto the JTable. [25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create a collection to embed the 3 branch document inside the Bank document like
(“Bank_name": ,"Contact": , "Address": ,"branch": ,“city”: )
that maintains all the related data in a single document. Branch should contain fields
like branch_id, branch_name&branch_address.
2) Insert at least 8 documents in a collection with suitable values. Verify your created
collection and database by using proper command.

B) Solve the Following Queries: [25 M]


1) Display all branches in individual city.
2) Updates the Address of branch in city Pune.
3) Add new branch in a city Baramati.
4) Delete the one branch in city Pune.
5) Count total branches in individual city.

OR

Q.2 Python:
A) Write a Python GUI program to create a list of Computer Science Courses using
Tkinter module (use Listbox). [15 M]

B) Write a Python program to accept two lists and merge the two lists into list of tuple.
[25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

28
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to check whether given candidate is eligible for voting or not.
Handle user defined as well as system defined Exception. [15 M]
B) Write a java program using Applet for bouncing ball. Ball should change its color
for each bounce.
[25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create a collection "Customer" which contains documents with the same structure
like this one:
{"_id" : ,"firstname" : ,"lastname" : ,"email" :
"password" : , "last_login" : ,"address" : {"country":
,"street" : , ,"zip" : ,}}
2) Insert at least 8 documents in a collection with suitable values. Verify your created
collection and database by using proper command.

B) Solve the Following Queries: [25 M]


1) Replace a single existing document entirely with other data.
2) Replace the document for current firstname field that you have taken in your
document.
3) Insert some other similar documents in it.
4) Find the first document which firstname field is equal "Rahul" and updates (sets) the
lastname field to "Patil".
5) Update multiple fields of a document.

OR
Q.2 Python:
A) Write a Python GUI program to calculate volume of Sphere by accepting radius as
input. [15 M]
B) Write a Python script to sort (ascending and descending) a dictionary by key and
value. [25 M]

Q.3 Viva [10 M]

Q.4 Lab Book [10 M]

29
Savitribai Phule Pune University
T.Y.B.B.A.(C.A.) Semester – V (CBCS 2019 Pattern) University Practical Examination
Lab Course: (CA-506) Computer Laboratory Based on 503, 504
Core Java, MongoDB / Python
Time: - 3 Hours] [Marks: - 100

Q.1. Core Java:


A) Write a java program to accept a number from a user, if it is zero then throw user
defined Exception “Number is Zero”. If it is non-numeric then generate an error
“Number is Invalid” otherwise check whether it is palindrome or not. [15 M]

B) Write a java program to design a following GUI (Use Swing). [25 M]

Q.2. MongoDB:
A) Solve the following: [15 M]
1) Create a collection employee in your database with the following type of documents:
{"_id": 1,"emp_name": { name: , surname: }, "age": ,"city":
“salary”: }
2) Insert at least 8 documents in a collection with suitable values. Verify your created
collection and database by using proper command.

B) Solve the Following Queries: [25 M]


1) Define a single field index on the age field and also drop created index.
2) Define a multiple field index on the age field for descending and city field for
ascending order.
3) Write mongo DB queries that will use the index both for retrieving the documents
and for sorting.
4) Retrieve all the indexes in the collection.
5) Find total salary spend on employee.
OR
Q.2 Python:
A) Write a Python GUI program to accept a string and a character from user and count
the occurrences of a character in a string. [15 M]
B) Python Program to Create a Class in which One Method Accepts a String from the
User and Another method Prints it. Define a class named Country which has a method
called print Nationality. Define subclass named state from Country which has a mehtod
called printState. Write a method to print state, country and nationality. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

30

You might also like