Advance PHP(2019)

 Slip 1

 

a)Write a PHP script tocreate a simple calculator that can accept two numbers and perform operationslike add, subtract, multiplication. (Use the concept of Class)

 

b)Write a PHP script tocreate student.xml file which contains student roll no, name, address, collegeand course. Print students detail of specific course in tabular format afteraccepting course as input.

 

Slip 2

 

a)Write a PHP script to demonstrate the introspection for examining classes and objects.(use function get_declared_classes().get_class_methods()and get_class_vars).

 

b)Write a script to solve following questions (Use "Student.xml" file)

i)Create a DOM Document object and load this XML file. ii) Get the output of this Document to the browser.

iii) Save this [. XML] document in another format i.e. in [.doc) Write a XML Script to print the names of the student present in “Student.xml" file.

 

Slip3

 a)Write a Calculator class that can accept two values, then add, subtract, multiply them or divide them on request. For example: $calc = new Calculator( 3, 4); echo $calc->add(); // Displays “7”. echo $calc->multiply(); // Displays “12"

 

b)Write a script to create "cricket.xml" file with multiple elements as shown below:

<CricketTeam>

<Team country="Australia">

<player>_ </player> <runs> </runs> <wicket> </wicket>

</Team>

</Cricket Team> Write a script to add multiple elements in "cricket.xml" file of category, country="India".

 

Slip4

a)Define a class Employee having private members – id, name, department, salary. Define parameterized constructors. Create a subclass called "Manager” with private member bonus. Create 3 objects of the Manager class and display the details of the manager having the maximum total salary (salary + bonus).

 

b)Create an xml file which should comprise the following:

<cricket> <player>Sachin Tendulkar</player> <runs>2000</runs> <wickets> 100</wickets> <noofnotout>20</noofnotout> </cricket> For at least 5 players. Write a PHP script to display the details of players who have scored more than 1200 runs and at least 50 wickets.

 

Slip 5

a)Create an abstractclass Shape with methods area() and volume ). Derive three classes rectangle(length, breath), Circle(radius) and Cylinder(radius, height), Calculate areaand volume of all. (Use Method overriding).

 

b)Create student table as follows:

Student(sno, sname, standard, Marks, per). Write AJAX script to select the student name and print the student's details of particular standard.

 

Slip 6

a) Write a PHP script, which will return the following component of the URL (Using response header)

http://www.college.com/Science/CS.php List of Components: scheme, host, path Expected output: Scheme: http Host: www.college.com Path: /Science/CS.php

 

b)Create employee table as follows EMP (eno, ename, designation, salary). Write Ajax program to select the employees name and print the selected employee's details.

 

 Slip 7

a)Define an Interface which has method gmtokg() &kgtogm(). Create Class Convert which implements this interface & convert the value kg to gm and gm to kg.

 

b)Consider the following relational database:

Project (P_Group No, Project_Tiltle) Student (Seat_no, Name, Class, P_Group_No) Write an AJAX script to accept project title and display list of students those who are working in a particular project.

 

Slip 8

 

a)Write a PHP Script tocreate class Shape and its sub-class Triangle, Square, Circle and display areaof selected shape (use concept of inheritance).

 b)Write an Ajax scriptto get player details from XML file when user select player name. Create XMLfile to store details of player (name, country, wickets and runs).

 

Slip 9

 a)Write a PHP program to create a Class Calculator which will accept two values from user and pass as an argument through parameterized constructor and do the following task: a) Add b) Subtract c) Multiply them together or divide them on request.

 

b)Consider the following entities and their relationships

Movie(movie no,movie_name,release_year) Actor(actor no,name) Relationship between movie and actor is many-many with attribute rate in Rs. Create a RDB in 3 NF. With using three radio buttons (accept, insert, update) Write an AJAX script to accept actor name and display names of movies in which he has acted.

 

 

Slip 10

 

a)Write a PHP Script to demonstrate the concept of Introspection for examining object. (Using any 3 predefined functions).

 

b)Write a PHP script to perform the following stack related operations- insert, delete and display. (Use concept of self processing form)

 

Slip 11

a)Write a PHP program to create class circle having radius data member and two member functions find circumference and find_area(). Display area and circumference depending on user's preference.

 

b)Write an Ajax code to print the content of "Myfile.dat" on clicking on fetch Button. The data fetches from the server using Ajax Technique.

 

Slip 12

 

a)Write a PHP program to convert temperature Fahrenheit to Celsius using sticky form.

 

b)Write an AJAX script to read contact.dat file and print the content of a file in a tabular form when the user clicks on print button. Contact.dat file contains srno, name, residence number, mobile number (Enter at least 3 records in contact.dat file)

 

Slip 13

 

a)Create a form toaccept Employee detail and display it in next page. (Use sticky form concept).

 

b)Create web Application that contains Voters details and check proper validation for (name, age, and nationality), as Name should be in upper case letters only, Age should not be less than 18 yrs and Nationality should be Indian.(use HTML-AJAX-PHP)

 

Slip 14

 

a)Write a PHP script to accept a string from user and then display the accepted string in reverse order. (use concept of self processing form)

 

b)Write a PHP script using AJAX concept, to check user name and password are valid or Invalid (use database to store user name and password).

 

Slip 15

a)Write PHP program to select list of subjects from list box and displays the selected subject information on next page. (Use sticky Multivalued parameter).

 

b)Write a PHP script using AJAX concept, to give hint to user when he/she type city name in the text field.

 

Slip 16

a)Write a PHP programto accept two string from user and check whether entered strings are matchingor not.(use sticky form concept)

 

b)Write Ajax program to carry out validation for a username entered in textbox. If the textbox is blank, print 'Enter username'. If the number of characters is less than three, print' Username is too short. If value entered is appropriate the print 'Valid username'.

 

Slip 17

a)Write a PHP Script to display Server information in table format (Use $_SERVER).

 

b)Write a script to create XML file "University.xml”. The elements details of "University.xml” are as

follows: <Univ> <Uname> ---------</Uname> <City>---------</City> <Rank>---------</Rank> </Univ>

1) Store the details of at least 3 universities. 2) Link the “University.xml" file to css and get well formatted output as given below....

i) Uname : Color: black;

Font-family: copperplate Gothic Light; Font-size: 16 pt

Font: Bold; ii) City and Rank : Color : Yellow;

Font-family: Arial; Font-size: 12 pt Font: Bold;

 

Slip 18

 

a)Write a PHP program to create a simple distance calculator that can accept distance in meters from

user. Convert it into centimeter or kilometer according to user preference. (use radio buttons and Self Processing form)

 

 

b)Write a PHP script to generate an XML in the following format.

<?xml version = "1.0" ?> <Book Store> <Books>

<PHP>

<title>Programming PHP</title> <publication>O’RELLY</publication>

<price> 800</price> </PHP> <PHP>

<title>Beginners PHP</title> <publication>WROX</publication>

<price>900</price> </PHP> </Books>

</Book Store> Add more than 5 books details. Display details of book by selecting the publication of book from user.

 

Slip 19

 

a)Write a PHP program to read the XML document "stock_list.xml" (fruits and vegetables) which creates XML document and parse the XML data into an array.

 

b) Write a Ajax program to get book details from XML file when user select book name. Create XML file to store details of book(name, author, year and price).

 

Slip 20

a)Create a XML file which gives details of movies available in “Venus CD Store" from following categories a) Classical b) Action c) Horror Elements in each category are in the following format <Category> <Movie Name>----</Movie Name> <Release Year>----</Release Year> <Actor Name>----</Actor Name> </Category> Save the file with name "movies.xml".

 

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) Fibonacci Series. 2) To find sum of the digits of that number. (Use the concept of self processing page.)

 

Slip 21

a)Write a script to create XML file named “Course.xml"

<Course>

<Computer Science>

<Student name>.......</Student name> <Class name> ......</Class name>

<percentage>.....</percentage> </Computer Science> </Course> Store the details of 5 students who are in SYBBA(CA).

 

b)Create a class Student with data members Roll No. Name, PRN number. Derive class Marks from student with data members M_PHP, M_OS, M_CPP, M Networking and derive a class Result from class Marks with members (Total_Marks, Percentage, Grade). (Use Interface Concept) Write a Menu driven program in PHP to perform the following operations

i.Accept Student Information ii. Display Student Information with its result.

 

Slip 22

a) Create a XML file which gives details of books available in “Pragati Bookstore" from following categories.

1) Yoga 2) Story 3) Technical and elements in each category are in the following format

<Book>

<Book_Title> --------------</Book_Title> <Book_Author> ---------</Book Author> <Book_Price> ----</Book_Price>

</Book> Save the file as “Bookcategory.xml"

 

b)Create a Basic Page in Drupal titled "About Me”. Add the details about yourself in the page. Also place this page link in the Main Menu. Display this menu link before all the menu items. Show text “This is <your name>" when move the mouse pointer at this menu link.

 

Slip 23

a)Create an application that reads "Sports.xml" file into simple XML object. Display attributes and elements. (Hint: Use simple_xml_load_file() function)

 

b) Write Ajax program to print Movie details by selecting an Actor's name.

Create table MOVIE and ACTOR as follows with 1 : M cardinality MOVIE (mno, mname, release_yr) and ACTOR(ano, aname)

 

Slip 24

 

a)Write a script to create XML file named "College.xml"

The element details of "College.xml" are: <College >

<Cname>-----</Cname> <City>----</City>

<Rank>----</Rank> </College> Display at least 3 colleges Information.

 

b)Create a Basic Page in Drupal titled “DepartmentPortal”. Add the details about Departments and Teacher details in the page. Also place this page link in the Main Menu.

 

Slip 25

a) Write a script to create "vehicle.xml" file with multiple elements as given below

<Vehicle>

<Type = Two Wheeler>

<Vehicler Name > -------- </Vehicle Name> <Company >--------- </Company> <Color>--------</Color>

<Average) ------</Average> </Type> </Vehicle> Also add Type = “Four Wheeler” and its elements

 

b) Write a PHP program to implement Create, Read, Update and Display operations on Teacher table with attributes (tid, tname, address, subject). (Use Radio Buttons)

 

Slip 26

a)Write a simple PHP program which implements Ajax for addition of two numbers. 

 

b)Create a front-page article in Drupal titled “My Article". Write an article about PHP programming Language and add to the article page. Display an Image appropriate to the Article at the bottom of the Article. Also place this page link in the Main Menu. Display this menu link before all the menu items. Show text “This is your name>" when move the mouse pointer at this menu link. Also post a comment about your article.

 

Slip 27

 

a)Write a simple PHP program which implements Ajax for Factorial of a numbers.

 

b)Write a PHP script to read book.XML and print book details in tabular format using simple XML(Content of book.XML are book_code, book_name, author, year ,price).

 

Slip 28

a)Write an Ajax programto display list of games stored in an array on clicking OK button.

 

b)Create a Block in Drupal titled "College Site". The block should be displayed in the left side of each page. The block should contain announcement about an upcoming event in your college. Also change the theme of your website by following properties:

a)Change the background colour.

b)Change the logo image.

 

Slip 29

 

a)Write a PHP scriptusing AJAX concept, to develop user-friendly and interactive search engine(like a Google search engine)

 

b)Write a PHP Script to create a super class Vehicle having members Company and price. Derive 2 different classes: LightMotor Vehicle (members – mileage) Heavy Motor Vehicle (members - capacity-in-tons). Define 5 Object of each subclass and display details in table format

 

Slip 30

 

a)Derive a class Rectangle from class Square. Create one more class Triangle. Create an interface with only one method called cal_area (). Implement this interface in all the classes. Include appropriate data members and constructors in all classes. Write a program to accept details of a Rectangle, Square and

Triangle and display the area.

 

b)Develop a module in Drupal to create a page showing your contact details (name, roll_no, address, and phone). Also add Navigation on the Home Page called “Contact Details”.