0% found this document useful (0 votes)
30 views30 pages

Java, AngularJS, PHP Lab Exercises

Uploaded by

adwaghmare450
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)
30 views30 pages

Java, AngularJS, PHP Lab Exercises

Uploaded by

adwaghmare450
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

MES Garware College Of Commerce

T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q1. Core Java:
A) Write a ‘java’ program to copy only non-numeric data from one file to another file.
[25 M]
B) Write a ‘java’ program to display characters from ‘A’ to ‘Z’. [15 M]

Q2. AngularJS:

A)Write an AngularJS script to display list of games stored in an array on click of


button using ng-click. And also Demonstrate ng-init, ng-bind directive of AngularJS.
[40 M]

OR
PHP:
A)Write a PHP script for the following: Design a form to accept a string. Write a
function to count the total number of vowels (a,e,i,o,u) from the string. Show the
occurrences of each vowel from the string. Check whether the given string is a
palindrome or not, without using built-in function. (Use radio buttons and the concept
of function. Use ‘include’ construct or require stmt.) [25 M]

B) A college has given roll number to each student, The roll number is six digit
number where first two digits are faculty([Link]., BCA, BA) third digit is year (Ist(1),
IInd(2) and IIIrd(3)) and last three digit are actual number. Write PHP script to accept
a number and print faculty, year and roll number of student.(e.g
Rollno=BC1004,faculty=BCA, year=1st,rollno=004) [15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

1
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java:
A)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. (Use
Swings) [25 M]
B) Write a java program to display all the vowels from a given string. [15 M]
Q2. AngularJS:

A)Write a HTML code using AngularJS to generate the following output


Undergraduate Courses (hint : use ng-repeat, ng-init directive)
i. BBA(CA)
ii. BCA(Science)
iii. [Link].(Computer Science)
Post Graduate Courses
i. [Link].(Computer Science)
ii. [Link].(CA)
iii. MCA [40 M]

OR
PHP:
A)Write a PHP script for the following: Design a form to accept two strings from the
user. Find the first occurrence and the last occurrence of the small string in the large
string. Also count the total number of occurrences of small string in the large string.
Provide a text box to accept a string, which will replace the small string in the large
string. (Use built-in functions) [25 M]
B)Write a PHP script to demonstrate the introspection for examining class(use
function get_declared_classes() ,get_class_methods() and get_class_vars()).
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

2
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java:
A) 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]
B) Write a ‘java’ program to check whether given number is Armstrong or not. (Use
static keyword)
[15 M]
Q.2. AngularJS:

Using AngularJS display the 10 student details in Table format (using ng-repeat
directive use Array to store data) [40 M]

OR

PHP:
A)Write a PHP script for the following: Design a form to accept two numbers from
the user. Give options to choose the arithmetic operation (use radio buttons). Display
the result on the next form. (Use the concept of function and default parameters.
[25 M]
B)Write a PHP script for the following: Design a form to accept a number from the
user. Display the number and its factorial as a result on the next form. (Use the
concept of function and default parameters.
[15 M]

Q.3 Viva [10


M]
Q.4 Lab Book [10
M]

3
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506

Q.1. Core Java:


A) Write a java program using Applet to implement a simple arithmetic calculator.[25
M]

B) Write a java program to display alternate character from a given string. [15 M]
Q.2 AngularJS:
A) Write an AngularJS script to print details of bank (bank name, MICR code, IFC
code, address etc.) in tabular form using ng-repeat [40 M]

OR

PHP:
A)Write a PHP script for the following: Design a form to accept two strings from the
user. Find whether the small string appears at the start of the large string. Provide a
text box to accept the string that will replace all occurrences of small string present in
the large string. Also split the large string into separate words. (Use regular
expressions) [25 M]
B)Write a Calculator class that can accept two values, then add them, subtract them,
multiply them together, or divide them on request. For example:
$calc = new Calculator( 3, 4 );
echo $calc- >add(); // Displays “7”
echo $calc- >multiply(); // Displays “12” [15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

Q.1. Core Java:

4
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
A) 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]
B) Write a java program to display following pattern:
5
45
345
2345
12345 [15 M]
Q.2 AngularJS:
Write an AngularJS script for addition of two numbers using ng-init, ng-model & ng-
bind. And also Demonstrate ng-show, ng-disabled, ng-click directives on button
component. [40 M]
OR

PHP:
A)Write a PHP script for the following: Design a form to accept the details of 5
different items, such as item code, item name, units sold, rate. Display the bill in the
tabular format. Use only 4 text boxes. (Hint : Use of explode function.)
[25 M]
B)Write a PHP program to create a simple calculator that accepts two numbers and
performs operations like add, subtract, multiplication and divide (using Self
Processing form) [15mks]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

Q.1. Core Java


A) Write a java program to display transpose of a given matrix. [25
M]

5
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
B) 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]

Q.2 AngularJS:
A) Using AngularJS Create a SPA that show Syllabus content of all subjects of
SYBBA (CA)(use ng-view)

OR
PHP:
A)Write a PHP script for the following: Design a form to accept two strings. Compare
the two strings using both methods (= = operator &strcmp function). Append second
string to the first string. Accept the position from the user; from where the characters
from the first string are reversed. (Use radio buttons)
[25 M]
B)Accept a number from the user and write a PHP program to display the
multiplication table of the number. Use SELF processing form.
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

6
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java
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]
A) Write a java AWT program to display Label with text “Dr. D Y Patil College”,
background color Red and font size 20 on the frame.
[15 M]
Q.2 AngularJS:
A) Using AngularJS Create a SPA that show Syllabus content of all subjects of
SYBBA (CA)(use ng-view) [40 M]

OR

PHP
A) Write a menu driven PHP program to perform the following operations on an
associative array: i. Display the elements of an array along with the keys.
ii. Display the size of an array
iii. Delete an element from an array from the given index.
iv. Reverse the order of each element’s key-value pair.[Hint: use array_flip()]
v. Traverse the elements in an array in random order [[Hint: use shuffle()].
[25 M]
B).Write a PHP Script login form and validate the password. Validation is the
username and password should be same. Display “Authentic Login” is correct
password and “INCORRECT LOGIN” if incorrect password (Use Sticky form
concept) [15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

7
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java
A) Write a java program to display files having extension .txt from a given directory.
[25M]
B) 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]
Q.2 AngularJS:
A) Create an HTML form using AngularJS that contain the Student Registration
details and validate Student first and last name as it should not contain other than
alphabets and age should be between 18 to 50 and display greeting message
depending on current time using ng-show (e.g. Good Morning, Good Afternoon,
etc.)(use AJAX). [40 M]

OR
PHP
A)Write a menu driven PHP program to perform the following operations on
associative arrays:
a) Sort the array by values (changing the keys) in ascending, descending order.
b) Also sort the array by values without changing the keys.
c) Filter the odd elements from an array.
d) Sort the different arrays at a glance using single function.
e) Merge the given arrays.
f) Find the Union, intersection& set difference of two arrays.
[25 M]
B)Create an abstract class Shape with methods calc_area( ) and calc_volume( ).
Derive two classes Sphere(radius) , Cone(radius, height). Calculate area and volume
of all. (Use Method overriding).
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

Q.1. Core Java

8
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
A) 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]
A) Write a java Program to display Fibonacci series of n nos. [15
M]
Q.2 AngularJS:
A) Create an HTML form using AngularJS that contain the Employee Registration
details and validate DOB, Joining Date, and Salary and also create a simple
arithmetic calculator using radio buttons (use ng-switch, ng-switch-when)
[40 M]

OR

PHP
A)Write PHP script to define an interface which has methods area(), volume(). Define
constant PI. Create a class cylinder which implements this interface and calculate area
and volume. [25M]
B)Create a form to accept employee details like name(first middle,last), address,
mobile number, PAN number from the user. Once the information is accepted display
all the information on next form. [15
M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

9
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506

[Link] Java
A)Write a java program for the following: Use Swings [25 M]

B)Write a java program to count the frequency of each character in a given string. [15
M]
Q.2 AngularJS:
A) Using AngularJS Create a SPA that show address and contact details of Some 5-10
top Hotels which are in pune location.(use ng-view) [40 M]

OR

.PHP
A)Write class declarations and member function definitions for an employee(code,
name, designation). Design derived classes as emp_account(account_no,
joining_date) from employee and emp_sal(basic_pay, earnings, deduction) from
emp_account. Write a menu driven PHP program
a) to build a master table
b) to sort all entries
c) to search an entry
d) Display salary. [25 M]
B)Write a PHP script to accept username and password. If in the first three chances,
username and password entered is correct, then display “Welcome User” on the
second form, otherwise display error message.
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

Q.1. Core Java

10
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
A) Create a calculator with functionality in an Applet. [25
M]

B)Write a menu driven java program using command line arguments for the
following: [15 M] 1. Addition 2. Subtraction 3. Multiplication 4. Division.
Q.2 AngularJS:
A) Using AngularJS Create a SPA that show History of some(4-8) Historical Places
(use MVC). [40 M]

OR

PHP
A)Derive a class square from class Rectangle. Create one more class circle. Create an
interface with only one method called area(). Implement this interface in all the
classes. Include appropriate data members and constructors in all classes. Write a PHP
program to accept details of a square, circle and rectangle and display the area.
[25 M]
B)Write a PHP script to accept 5 numbers in an array and display the same.
[15M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

11
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java
A) Write a java program to display multiplication table of a given number into the
List box by clicking on button.
[25 M]
B) Write a java program to display each String in reverse order from a String array.
[15 M]
Q.2 AngularJS:
A) Using AngularJS Create a SPA for customer registration visiting a departmental
store. Form should consists of fields such as name, contact no., gender, favourite
item(to be selected from a list of items with Quantity) and suggestions. Display the
Bill with total no of items selected and total amount to be paid.(use filter)
[40 M]

OR

PHP
A)Write PHP Script to create a class account (accno,cust_name). Derive two classes
from account as saving_acc(balance, min_amount) and current_acc(balance,
min_amount). Display a menu a) Saving Account b) Current Account For each of this
display a menu with the following options. 1. Create account 2. Deposit 3.
Withdrawal [25 M]
B)Write a PHP script for the following: Design a form to accept a number from the
user. Perform the operations and show the results.
1) Factorial of a number using Recursion.
2) Add the digits of that number to reduce it to single digit.
(use the concept of self processing page.) [15 M]

Q. 3 Viva [10 M]
Q.4 Lab Book [10 M]

12
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java
A) 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]
B) 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]
Q.2 AngularJS:
A) Using AngularJS create a SPA that accept the details of student and display mark
sheet ( roll_ no, student_ name, class, sub1, sub2, sub3, total, percentage, grade)

[40 M]

OR

PHP
A)Write class declarations and member function definitions for following
employee (code, name, designation). Design derived classes as emp_account
(account_no, joining_date) from employee and emp_sal(basic_pay, earnings,
deduction) from emp_account. Write a PHP Script to create 5 objects (pass details
using parameterized constructor) and Display details of Employees who having
Maximum and Minimum Salary.
[25 M]
B)Create student registration form and display details in the next page.
(Use sticky form concept). [15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

13
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java
B) Write a java AWT program to accept the details of employee (Eno, EName, Sal)
and display it on next frame using appropriate event. [25 M]
A) Write a Java program to calculate power of a number using recursion. [15 M]
Q.2 AngularJS:
A) Using AngularJS Create a SPA to take the information of a customer for booking a
plan consisting of fields such as name, address, contact no., gender, Date of booking,
date of journey, no of passenger, name of passenger etc. Display the e –Ticket.

[40 M]

OR

PHP
A)Using regular expressions check for the validity of entered email-id. The @ symbol
should not appear more than once. The dot (.) can appear at the most once before @
and at the most twice or at least once after @ symbol. The substring before @ should
not begin with a digit or underscore or dot or @ or any other special character. (Use
explode and ereg function.)
[25 M]
B)Write a PHP Script to display Server information in table format (Use $_SERVER).
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

14
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java
A) Write an applet application to display smiley face. [25
M]

B) 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]
Q.2 AngularJS:
A) Using AngularJS Create a SPA for Bus Ticket Reservation consisting of fields :
Name, Address, contact no, source station(Dropdown list), Destination station, Date
of booking, date of journey, no of passenger, name of passenger, gender of passenger
etc. Display the e –Ticket. [40 M]

OR

PHP
A)Write PHP program to create input form for Grocery that displays List of grocery
items with checkboxes and create a bill according to list of items selected after
clicking submit button.
[25 M]
B)To create form that accept the user details. write php program to capitalize of first
letter of each name and check user email address contain @ symbol.
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

15
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java
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]
A)Write a java program to calculate sum of digits of a given number using recursion.
[15 M]
Q.2 AngularJS:
A) Using AngularJS display the student details who are live in pune in Table format
(using ng-repeat directive, use Array to store data, use filter )
[40 M]

OR

PHP
A)Write a PHP program that accept customer name, consumer number and number of
electricity units consumed from an input form and print electricity bill from following
data
● For first 50 units – Rs. 3.50/unit
● For next 100 units – Rs. 4.00/unit
● For next 100 units – Rs. 5.20/unit
● For units above 250 – Rs. 6.50/unit
● Fixed meter and service charge- Rs. 150/- [25
M]
B)Design a HTML page to accept a number and write a PHP script to display that
number in words e.g. 123 -one two three
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

16
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java:
A) 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]
B)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]
Q.2 AngularJS:
A) Write an AngularJS script to search student name according to the character typed
and display details( use array and filter). [40 M]

OR

PHP
A)Write a PHP program for course registration of Learner in an institute that accept
Name, Course to be admitted, Mobile number using input form validation such as
Name should be only string of character, mobile number should contain digits with
valid length and so on. and give feedback to Learner with registration details
including registration number. [25 M]
B)Accept a String from the user. Write a PHP function to count the total number of
vowels (a,e,i,o,u) from the string. Show the occurrences of each vowel from the string
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

Q.1. Core Java:

17
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
A) 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]
A) Write a Java program to calculate area of Circle, Triangle & Rectangle.(Use
Method Overloading)
[15 M]
Q.2 AngularJS:
A) Using AngularJS create a SPA that shows Teacher Profile who are teaching
SYBBA (CA) with photo. [40 M]

OR

PHP:
A)Write a PHP script to create a login form with a username and password. Once the
user logs in, the second form should be displayed to accept user details (name, city,
phoneno). If the user doesn’t enter information within a specified time limit, expire
his session and give a warning.
[25 M]
B)Write a PHP script to accept a string and then display each word of string in reverse
order. (use concept of self processing form)
[15M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

18
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java:
A) Create an Applet that displays the x and y position of the cursor movement using
Mouse and Keyboard. (Use appropriate listener)
[25 M]
B) Write a Java program to display Fibonacci series using function.
[15 M]
Q.2 AngularJS:
A) Using AngularJS display the Employee details order by salary in Table format
(using ng-repeat directive, use Array to store data, use filter)
[40 M]

OR

PHP:

A)Design HTML page to read the value for n. Write a PHP script to display first n
even numbers with font size = 12 and color = red and first n odd numbers with font
face = Times new Roman , size = 17 & color = yellow.
[25 M]
B)Write PHP program to select list of subjects (use multivalued parameter) displays
on next page.(Use listbox to select subject)
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

19
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java:
A) 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]
B) 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]
Q.2 AngularJS:
A) Using AngularJS create a SPA that to accept the details such as name, mobile
number, pin-code and email address and make validation. Name should contain
character only, mobile number should contain only 10 digit, Pin code should contain
only 6 digit, email id should contain only one @, . Symbol
[40 M]

OR

PHP:
A)Write a PHP script to change the preferences of your web page like font style, font
size, font color, background color using cookie. Display selected settings on next web
page and actual implementation (with new settings) on third web page.
[25 M]
B)Write a PHP program to accept two string from user and check whether entered
strings are matching or not.(use sticky form concept)
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

20
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java:
A) 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]
B) Write a java program to display each word from a file in reverse order. [15
M]
Q.2 AngularJS:
A) Using AngularJS create a SPA that to accept the details of doctor(5-6) having
field’s dno, dname, address, and phone number. Display those in table format. (use
MVC.) [40 M]

OR

PHP:
A)Write a PHP script to create a form to accept student information (name, class,
address). Once the student information is accepted, accept marks in next form (Phy,
Bio, Chem, Maths, Marathi, English).Display the mark sheet for the student in the
next form containing name, class, marks of the subject, total and percentage.
[25 M]
B)Write PHP script to demonstrate the concept of introspection for examining object.
[15 M]

Q.3 Viva [10


M]
Q.4 Lab Book [10
M]

21
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java:
A) 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.
b) Write a Java program to calculate factorial of a number using recursion.
[15 M]
Q.2 AngularJS:
A) Using AngularJS create a SPA that accept Voters details and check proper
validation for (name, age, and nationality) as Name should be in upper case letters,
Age should not be less than 18 yrs and Nationality should be Indian.
[40 M]

OR

PHP:
A)Write a PHP program to create a shopping mall UI. User must be allowed to do
purchase from two pages. Each page should have a page total. The third page should
display a bill, which consists of a page total of whatever the purchase has been done
and print the total. (Use http session tracking).
[25 M]
B)Write a PHP Script to display response header information for any text file using
$_http_response_header. [15
M]

Q.3 Viva [10


M]
Q.4 Lab Book [10
M]

22
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java:
A) Write a java program to design following Frame using Swing.
[25 M]

B) 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]
Q.2 AngularJS:
A) Using AngularJS create a SPA to carry out validation for a username entered in
textbox. If the textbox is blank, alert ‘Enter username’. If the number of characters is
less than three, alert ’ Username is too short’. If value entered is appropriate the print
‘Valid username’ and password should be minimum 8 characters.
[40 M]

OR
PHP:
A)Write a PHP script to create a form to accept customer information (name, address,
ph-no). Once the customer information is accepted, accept product information in the
next form (Product name, qty, rate). Display the bill for the customer in the next form.
Bill should contain the customer information and the information of the products
entered. [25 M]
B)Write a menu driven program in PHP to perform the following stack related
operations:[Hint: use Array_push(), Array_pop(), Array_shift(), array_unshift()
functions]
i. Insert an element in stack
ii. Delete an element from stack
iii. Display the contents of stack
[15 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

23
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506

Q.1. Core Java:


A) 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]
A) Write a java program to count number of digits, spaces and characters from a file.
[15 M]
Q.2 AngularJS:
A) Using AngularJS create a SPA to fetch suggestions when is user is typing in a
textbox. (eg like google suggestions. Hint create array of suggestions and matching
string will be displayed). [40 M]

OR
PHP:
A)Write a PHP script to accept username and password. If in the first three chances,
username and password entered is correct, then display second form, otherwise
display error message. [25 M]
B)Write a menu driven program in PHP to perform the following queue related
operations: [Hint:use Array_push(), Array_pop(), Array_shift(), array_unshift()
functions] [15M]
i. Insert an element in queue
ii. Delete an element from queue
iii. Display the contents of queue
Q.3 Viva [10 M]
Q.4 Lab Book [10 M]

Q.1. Core Java:


A) Write a java program to check whether given string is palindrome or not. [15 M]

24
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
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 AngularJS:
A) Create an HTML form Using AngularJS for Login system and validate email ID
using Regular Expression and password should be minimum 8 characters.
[40 M]

OR

PHP:
A)Write a PHP Script for the following:
-.Declare a Multidimensional Array.
-.Display specific element from a Multidimensional array.
-.Also delete given element from the Multidimensional array.
-.Define an array. [25
M]
B)Write a PHP program to accept two string from user and check whether entered strings are
matching or not.(use sticky form concept) [15 M]

Q.3 Viva [10


M]
Q.4 Lab Book [10
M]

25
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
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 AngularJS:
A) Using AngularJS create a SPA for eLearning System. [40 M]

OR

PHP:
A)Derive a class square from class Rectangle. Create one more class circle. Create an
interface with only one method called area(). Implement this interface in all the
classes. Include appropriate data members and constructors in all classes. Write a PHP
program to accept details of a square, circle and rectangle and display the area.
[25 M]
B)Write a menu driven program in PHP to perform the following operations on an
associative array:
i. Accept the array
ii Display the elements of an array along with the keys.
iii. Display the size of an array
iv. Delete an element from an array from the given index. [25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

26
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
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 AngularJS:
A) Using AngularJS create a SPA for a Recipe Book. [40 M]

OR

PHP:

A)Write PHP script to define an interface which has methods area(), volume(). Define
constant PI. Create a class cylinder which implements this interface and calculate area
and volume.
[25M]
A)Write a PHP script to change Background color of the browser using switch
statement according to day of the week.
[ 15 M]
Q.3 Viva [10 M]
Q.4 Lab Book [10 M]

27
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
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 AngularJS:
A) Using AngularJS create a SPA that clone the “Hacker News” website.
[40 M]

OR
PHP:

A)Write a menu driven PHP program to perform the following operations on an


associative array:
i. Display the elements of an array along with the keys.
ii. Display the size of an array
iii. Delete an element from an array from the given index.
iv. Reverse the order of each element’s key-value pair.[Hint: use array_flip()]
v. Traverse the elements in an array in random order [[Hint: use shuffle()].
[25 M]
B)Write a PHP script to accept the details of Employee(EName, Designation,
Department Gender ,Salary) and display it on next page.

Q.4 Viva [10 M]


Q.5 Lab Book [10 M]

Q.1. Core Java:


A) Write a java program using Applet to display a smiley. [25 M]

28
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
B) 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]
Q.2 AngularJS:
A) Using AngularJS Develop Online School System. [40 M]

OR

PHP:
[Link] a php script to demonstrate any 6 built-in string functions. Accept data from
the user as required.
B. Write a simple PHP program which accepts two numbers and displays the addition
and subtraction of the numbers(use functions).

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

29
MES Garware College Of Commerce
T.Y.B.B.A.(C.A.) Semester - V
Lab Course: (CA-506) Computer Laboratory Based on
B4-21/501 and B4-21/504 ( 4 credit )
Code: B4-21/506
Q.1. Core Java:
A) Write a java program to design a following GUI (Use Swing).
[25 M]
B) 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]
Q.2 AngularJS:
A) Using AngularJS Implement E-commerce Website. [40 M]

OR

PHP:
A)Write a PHP script for the following: Design a form to accept two strings. Compare
the two strings using both methods (= = operator &strcmp function). Append second
string to the first string. Accept the position from the user; from where the characters
from the first string are reversed. (Use radio buttons)
[25 M]

Q.3 Viva [10 M]


Q.4 Lab Book [10 M]

30

Common questions

Powered by AI

Exception handling in Java is crucial for enhancing program reliability by managing runtime errors gracefully. In scenarios involving file validation and input checking, try-catch blocks can be used to handle exceptions like FileNotFoundException or InputMismatchException without crashing the program . When an exception occurs, developers can log the error, provide meaningful messages to users, or attempt recovery operations, ensuring that programs remain stable and usable. This reliability is further enhanced by creating custom exceptions for specific use cases, such as invalid data inputs, which can improve clarity and control when dealing with complex validation logic. The consistent use of exceptions fosters robust error management and improved debugging experiences.

Abstract classes in Java provide a template for creating a class hierarchy where common behavior is defined once, allowing subclasses to inherit and implement specific details. When applied to geometric shapes, an abstract class like 'Shape' can define methods such as calc_area() and calc_volume() without implementing them, leaving specific calculations to subclasses like Sphere or Cone . Method overriding allows these subclasses to provide their specific implementations for these operations. This architecture is extensible because new shapes can be added by merely creating new subclasses with specific implementations without altering existing code. This design approach promotes code reuse and a clean separation of concerns, essential for growing and maintaining complex systems.

Encapsulation in both Java and PHP involves bundling data with methods that operate on it, and restricting direct access to some of the object's components. This concept secures application data by exposing only necessary functionalities through public methods while keeping sensitive data private, which prevents unauthorized access and modification. When combined with effective data validation, encapsulation ensures that input is consistently checked for correctness and allowed formats before any processing or storage . For instance, ensuring user input adheres to expected formats like numbers, emails, or dates can prevent injection attacks and logical errors. Data validation techniques include regex checks, allowing only certain types, lengths, or patterns of input data, effectively mitigating risks of malformed input causing failures or vulnerabilities. Together, they form a strong defense mechanism that enhances security and reliability in Java and PHP applications.

Introspection in PHP enables developers to examine the properties, methods, and interfaces of objects at runtime, which is invaluable for debugging and maintaining object-oriented code. This capability allows developers to leverage PHP's reflection classes (e.g., ReflectionClass, ReflectionMethod) to dynamically explore the application's structure, aiding in understanding how different components interact and identifying potential issues . By using introspection, developers can generate documentation, perform automated testing, and ensure that objects adhere to expected interfaces without manually checking every object usage. This reduces debugging time and increases reliability, particularly in large or dynamically-typed codebases where keeping track of all dependencies and components manually would be arduous and error-prone.

Method overloading in Java allows multiple methods with the same name to exist as long as they have different parameter lists. This increases the flexibility and readability of the code because developers can use a single method name, such as 'calculateArea,' to compute areas for different shapes like circles, triangles, and rectangles, each with a different signature (e.g., calculateArea(double radius) for circles, calculateArea(double base, double height) for triangles). The key advantage is that it enhances code cohesion and simplifies the API, as developers do not need to remember various method names for similar operations. Method overloading effectively provides a more intuitive and less error-prone programming interface when dealing with similar operations across different objects.

Using PHP sessions in web applications presents several challenges, particularly in user authentication and data handling. First, session hijacking risks arise because sessions rely on passing a session identifier through a cookie, which can be intercepted if not properly secured through HTTPS . There's also a challenge in managing session data across different servers in load-balanced applications, where session data needs to be consistently synchronized or stored centrally. Furthermore, session storage can become inefficient as session data grows, affecting performance. In user authentication, improper session handling can lead to vulnerabilities such as session fixation or improper session termination, where users remain logged in longer than intended. Implementing secure, efficient session strategies requires careful consideration of these issues to maintain robust data security and application stability.

Creating a package in Java improves code organization by grouping related classes and interfaces under a defined namespace, making the code more modular and easier to manage. For numeric series generation, such as Fibonacci or cubes of numbers, using a package named 'Series' can encapsulate these functionalities into distinct classes (FibonacciSeries, CubeSeries, etc.). This separation enhances maintainability by isolating the series generation logic from unrelated code and clarifies dependencies, as each package can be developed, updated, or reused independently without affecting other parts of the application. Additionally, packaging ensures better access control and conflict avoidance by managing visibility of classes or methods within and outside the package. As a best practice in Java development, using packages supports scaling by allowing teams to work on different modules in parallel while maintaining a clean and organized project structure.

AngularJS facilitates the creation of Single Page Applications (SPAs), which significantly enhance user experience compared to traditional multi-page applications. SPAs load a single HTML page and dynamically update the content as the user interacts with the app, reducing the need for full page reloads. This results in faster response times and smoother navigation, as only the required content is updated via AJAX requests . AngularJS's data-binding and dependency management features allow developers to create a more interactive and responsive interface. Moreover, SPAs improve the user's perception of speed and contribute to seamless, app-like experiences with fewer disruptions, which is beneficial for functionality like form submissions, live previews, and real-time updates.

AngularJS directives like ng-repeat simplify dynamically creating HTML elements based on the contents of an array. In a student registration table, ng-repeat can iterate through an array representing student details and bind each item to individual row elements in the table. The directive establishes a two-way data-binding, meaning any change in the array automatically updates the view, producing a dynamic and interactive user interface without manual DOM manipulation . Furthermore, filters can refine this display, allowing only specific data sets to be showcased, which enhances the usability when dealing with educational data that require updates and sorting.

The array_flip() function in PHP is used to interchange keys with their corresponding values in an associative array, effectively reversing the role of keys and values where possible . It is significant because it allows developers to easily re-index arrays when the original index is needed as a value. On the other hand, the shuffle() function randomly reorders all the elements in an array . While shuffle() works primarily with indexed arrays by default, using it with associative arrays can help in scenarios where random order traversal is essential, even though keys will be lost which is a limitation. Together, these functions serve different yet often complementary purposes in manipulating and testing array traversal and content reordering.

You might also like