SPPU Question Paper - 2022 With Answers




Second Year BBA(CA) ADVANCE PHP SPPU Question Paper - 2022 With Answers


Instructions to the candidates:

  • Answer all questions
  • Figures to the right side indicate full marks.

Q1). Attempt any eight of the following:                     [8 * 2 = 16]



  • What is the use of abstract class ?
Ans:-    Abstract classes and methods are when the parent class has a
named method, but need its child class(es) to fill out the
tasks.

An abstract class is a class that contains at least one abstract
method. An abstract method is a method that is declared, but
not implemented in the code.


  • What is the $_Server variable ?
Ans:-     Server is a superglobal that holds information regarding HTTP
headers, path and script location etc. All the server and execution
environment related information is available in this associative
array. Most of the entries in this array are populated by web
server.


  • Enlist XML elements.
Ans:-     An XML element is everything from (including) the element's start tag to
(including) the element's end tag.

<price>29.99</price>

An element can contain:

Text attributes other elements

<bookstore> <book category="children">

<title>Harry Potter</title> <author>J K. Rowling</author>

<year>2005</year> <price>29.99</price>

</book> <book category="web">

<title>Learning XML</title> <author>Erik T. Ray</author>

<year>2003</year> <price>39.95</price>

</book> </bookstore>

In the example above:

<title>, <author>, <year>, and <price> have text content because they contain
text (like 29.99).

<bookstore> and <book> have element contents, because they contain elements.


  • What are different technologies are used in Ajax ?
Ans:-    Asynchronous JavaScript and XML. AJAX is a technique for
creating fast and dynamic web pages.

Ajax refers to JavaScript and XML, technologies that are widely used
for creating dynamic and asynchronous web content. While Ajax is
not limited to JavaScript and XML technologies, more often than not
they are used together by web applications. The focus of this tutorial
is on using JavaScript based Ajax functionality in JavaServer Faces
web applications.


  • What is Web Service ?
Ans:-   A web service is any piece of software that makes itself available
over the internet and uses a standardized XML messaging
system.

Web services are self-contained, modular, distributed, dynamic
applications that can be described, published, located, or
invoked over the network to create products, processes, and
supply chains.

These applications can be local, distributed, or web-based.

Web services are built on top of open standards such as

TCP/IP, HTTP, Java, HTML, and XML.


  • What is content Management system ?
Ans:-     Content Management System In PHP – A Content Management System is used to create, manage, and improve the digital experience of your customers. A CMS is a piece of software that allows users to collaborate on the creation, editing, and publishing of digital material such as web pages and blog posts.


  • What is Serialization ?
Ans:-   Serializing an object means converting it to a bytestream representation that can be stored in a file. This is useful for persistent data; for example, PHP sessions automatically save and restore objects. Serialization in PHP is mostly automatic—it requires little extra work from you, beyond calling the serialize( ) and unserialize( ) functions: $encoded = serialize(something); $something = unserialize(encoded); docstore.mik.ua/orelly/webprog/php/ch06_06.htm

  • Define UDDI.
Ans:-    UDDI stands for Universal Description, Discovery, and Integration.

UDDI is a specification for a distributed registry of web services.

UDDI is platform independent, open framework.

UDDI can communicate via SOAP, CORBA, and Java RMI Protocol.

UDDI uses WSDL to describe interfaces to web services.

UDDI is seen with SOAP and WSDL as one of the three foundation

standards of web services.

UDDI is an open industry initiative enabling businesses to discover
each other and define how they interact over the Internet.


  • What is PHP Frame work ?
Ans:-    A PHP framework is a platform to create PHP web applications. PHP frameworks
provide code libraries for commonly used functions, cutting down on the amount
of original code you need to write.

Why Use a PHP Framework?

There are many good reasons for using PHP frameworks as

opposed to coding from scratch.

Faster Development

Less Code to Write

. Libraries for Common Tasks

Follow Good Coding Practices

. More Secure Than Writing Your Own Apps

Better Teamwork


  • Define Template of object oriented .
Ans:-    Object-oriented programming, commonly referred to as OOP, is an approach which helps you to develop complex applications in a way that's easily maintainable and scalable over the long term. In the world of OOP, real-world entities such as PersonCar, or Animal are treated as objects. In object-oriented programming, you interact with your application by using objects. This contrasts with procedural programming, where you primarily interact with functions and global variables.


Q2) Attempt Any Four of the following:     [4 * 4 = 16]


  • Explain class and object with example.
Ans:-     Class is a group of member and its member
function. A class is blue
print of any object. A class is nothing when we can’t create object.

A class attributes and members are called its members.
<?php

class A

{

public function display()

{

$name="Hello";

echo $name;

}

}

$obj=new A();

$obj->display();

?>

Output:-

Hello

Object is an instance of class. We can create any
object with new keyword. In PHP, we can define objects in
similar ways. We can create multiple objects from class.

<?php

class A

{

public function display()

{

$name=“Object is created";

echo $name;

}

}

$obj=new A();

$obj->display();

?>

Output:-

Object is created


  • What is Document object model in PHP ?
Ans:-   The DOM defines a standard for accessing and manipulating
documents:

"The W3C Document Object Model (DOM) is a platform and
language-neutral interface that allows programs and scripts to
dynamically access and update the content, structure, and style of a
document."

The HTML DOM defines a standard way for accessing and
manipulating HTML documents. It presents an HTML document as
a tree-structure.

The XML DOM defines a standard way for accessing and manipulating
XML documents. It presents an XML document as a tree-structure.


  • What is SOAP ? Explain in detail ?
Ans:-   SOAP is an XML-based protocol for exchanging information between
computers

SOAP is a communication protocol

SOAP is for communication between applications.

SOAP is a format for sending messages.

SOAP is designed to communicate via Internet.

SOAP is platform independent.

SOAP is language independent.

SOAP is simple and extensible.


  • Explain features of Joomla / Drupal.
Ans:- Joomla contains thousands of verified third-party extensions, which can be found on Joomla extensions directory (i.e., extensions.joomla.org). There are several high-end templates available, and most of them are free to use. However, there is also an option to use paid themes that come with support. Templates are used to get different types of user interfaces, which allow us to change the colors, font style, layouts, and features, etc.

  • Explain with example how to connect database using php and Ajax.
Ans:-   here are 4 important and basic DB operations SIDU (Select Insert
Delete Update) or also called CRUD

(Create-insert, Read-select, Update, Delete) performed from
php.

1. mysql_connect() -- to connect to the mysql server from php
page.

ex.

$con = mysql_connect("localhost","root","admin"); /* the default port
no of mysql is 3306 */

$con = mysql_connect("localhost:3307","root","admin");

2. mysql_error() -- this function displays the error if the
connection was not made and it is generally executed from
another function called die(). The die() function terminates the
program.

ex.

$con = mysql_connect("localhost","root","admin")

or die("Sorry can not connect " . mysql_error());

Mysql _ select_db()--

this function selects the database to connect it passes 2 paramet

ex.

$con = mysql_connect("localhost","root","admin") or die("some
error " . mysql_error());

mysql_select_db("mytest",$con); ers

4. mysql_query()-- to perform any db operation at a time one.

mysql_query("insert into users values (5,'lata','sita nagar',
'akola')");

mysql_query("delete from users where rno = '2' ")

mysql_query("update users set addr = 'ram nagar' where addr='a
nagar'")



Q3) Attempt Any Four of the following:       [4 * 4 = 16]



  • Create a form to accept Employee detail and display in next page(Use sticky form concept)

Ans:-   Emp.html

<html>
<body>
<form method="POST" action="Lic.php">
Enter EMP No : <input type=text name="eno"><br>
Enter EMP Name : <input type=text name="name"><br>
Enter Address : <input type=text name="addr"><br>
<input type=submit value=Submit>
</form>
</body>
</html>


LIC.php
<?php
session_start();
$_SESSION['eno']=$_POST['eno'];
$_SESSION['name']=$_POST['name'];
$_SESSION['addr']=$_POST['addr'];
echo"Hello ".$_SESSION['name']." enter LIC details<br>";
?>
<form method="POST" action="Display.php">
Plan No:<input type="text" name="pno"><br>
Plan Name :<input type="text" name="pname"><br>
Premium :<input type="text" name="pre"><br>
<input type=submit value=Display>
</form>
Display.php

<?php
    session_start();
            echo"<Center>"."<b>Employee Details</b>"."<br>";
            echo"Emp No:".$_SESSION['eno']."<br>";
            echo"Emp name:".$_SESSION['name']."<br>";
            echo"Address:".$_SESSION['addr']."<br>"."<hr>";
            echo"<b>LIC Plan Details:</b>"."<br>";
            echo"Plan No:".$_REQUEST['pno']."<br>";
            echo"Plan Name:".$_REQUEST['pname']."<br>";
            echo"Premium:".$_REQUEST['pre']."<br>"."<hr>";

 ?>



  • Create an abstract class shape with method area() and volume(). Derive two classes rectangle (length,breath),Circle (radius).Calculate are and volume of all (Use Method Overriding).
Ans:-    abstract class shape
{
abstract void area();
abstract void volume();
}
class sphere extends shape
{
double pi=3.14;
double radius=4.35;
double ar=4*pi*radius*radius;
System.out.println("Area of Sphere is :"+ar);
}
void volume()
{
double vol=(4/3)*(pi*radius*radius*radius);
System.out.println("Volume of Sphere is :"+vol);
}
}class cone extends shape{
double pi=3.14;
double radius=4.35;
double height=6.45;
void area()
{
double tot=pi*radius*height;
System.out.println("Area of cone is :"+tot);
}void volume(){
double vol=(pi*radius*radius)*(height/3);
System.out.println("Volume of Cone is :"+vol);
}}
class cylinder extends shape
{
double pi=3.14;
double radius=4.35;
double height=6.45;
void area()
{
double A=(2*pi*radius*height)+(2*pi*radius*radius);
System.out.println("Area of Cylinder is :"+A);
}
void volume()
{
double V=pi*radius*radius*height;
System.out.println("Volume of Cylinder is :"+V);
}}
class box extends shape
{
int length=5;
int breadth=7;
double height=4.35;
void area(){
double a=(2*height*breadth)+(2*height*length)+(2*breadth*length);
System.out.println("Area of Box is :"+a);
}
void volume()
{
double v=length*breadth*height;
System.out.println("Volume of Box is :"+v);
}
public static void main(String a[])
{
sphere s=new sphere();
s.area();
s.volume();
cone c=new cone();
c.area();
c.volume();
cylinder cy=new cylinder();
cy.area();
cy.volume();
box b=new box();
b.area();
b.volume();
}
}


  • Write script to solve following questions (Use "Student.XML "file)
  1. Create a DOM document object and load this XML file
  2. Get the output of this document to the browser write a script to print the names of the student present in "Student.xml" file.

  • Write a PHP script to display server information in table format (Use $_server).

  • Write a PHP script for the following : Design a form to accept a number from the user. To find Sum of the digits of the number (Use the concept of self processing page)
________________________________________________________________


  • What is Inheritance ? Explain with suitable example.
  • How articles are created in Drpal R.Joomala?
  • Create a XML file which gives details of books available in "ABC Bookstore" from following. Categories 1.Technical 2.Cooking 3.Yoga
  • Define class Employee having private members id,name department,salary.Define parameterized constructor.Create a Subclass called "manager" with member bonus.  Create 6 objects of the manger class and display the details of the manager having the maximum total salary.(salary+bonus)
  • Explain setting response headers.

Q5)Write a short note on any two of the following :     [2 * 3 = 6]


  1. WSDL
  2. XML parser
  3. XMLHTTP Request object.


                               ----------Thank you---------