Skip to main content

Assignment Adv PHP

Q. 1)

a)  Write a PHP script to create a simple calculator that can accept t\vo numbers and perform operations like add, subtract, multiplication. (Use the concept of Class)     

                                                                                          

b) Write a PHP script to create student.xml file which contains student roll no, name, address, college and co urse. Print students detail of specific course in tabular format after accepting course as input.

Q. 2)

a) Write a PHP script to demonstrate the introspection for examining classes and  objects.  (use function get_declared_classesO ,get_class_methodsOand get_class_varsO),                                                                                          

b)     Write a 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.

  3. Save this [. XML] document in another format i.e. in [.doc]

Write a XML Script to print the names of the students present in the "Student.xml " file.

Q. 3) 

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(); II Displays "7"echo $calc- >multiply(); II Displays " 12"                                                                                          

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

<CricketTeam>

<Team country="Australia">

<player> ----------- <runs>      

</player>-----------</ runs>

      <wicket>-----------</wicket>

  </Team>

</CricketTeam >

Write a script to add multiple elements in "cricket.xm l" file of category, country=" India".


Q. 4)

a)Define a class Employee having private members - id, name, department, salary. Define parameterized const ru ctors. Create a subclass called "Mana ger" with private memb er bonus. C reate 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> I00 </ 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.                                                                                                                           

Q. 5)

a) Create an abstract class Shape with methods area( )   and volume( ). Derive three classes rectangle (length, breath), Circle(radius) and Cylinder(rad ius, hei ght) , Calculate area and volume of  all. (Use Method overriding).  [Marks 15]


 b) Create student table as follows: Student(sno, snam e, standard, Marks, per).Write AJAX script to select the student name and print the student's details of particular standard.

Q. 6)

a)      Write a PHP script, which will return the following component of th e 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.

Q. 7)

a)  Define an Interface which has method gmtokg() &kgtogm(). Create Class Convert which implements this interfa ce & convert the value kg to gm and gm to kg.                                                                                                       [Marks 15]

 

b)  Consider the following relational database: Project (P_Group No, Project_Tiltle)

Student (Sea t_no, Name, Class, P_Gro up_No)

Write an A JAX script to accept project title and display list of students who are workinin a particular project.

Q. 8)

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

Write an Ajax script to get player details from XML file when user select player name. Create XML file to store details of player (name, count ry, wickets and runs).


Q. 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 constru cto r and do the fo llow ing 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.


Q. 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)


Q. 11)

a) Write a PHP program to create class circle having radius  data  membeand  two member  functions find_c ircumfer ence() 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 clickin g on fe tc h Button. The Data fetches from the server using Ajax Techniqu e.


Q. 12)

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


       b)Write an AJAX script to read the contact.dat file and print the content of a file in a tabular   form when the user clicks on the print button. Contact.dat  filcontains  srnonameresidence  numbermobilnumber (Enter at least 3 records in contact.dat file)


Q. 13)

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

b)Create web Applicatio n th at co nta ins Voters details and check proper validation for (name, age, and nationality), as Name should be in upper letters only, Age should not be less than 18 yrs and Nationality should be Indian.(use HTML-AJAX-PHP)


Q. 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 nam e and password are valid or Invalid (use database to store user name and password).


Q. 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 con ce ptto  give hint to user when  he/she type  city name  in the  text field.


Q. 16)

a)  Write a PHP program to accept two string from user and check whether entered strings are matching or not.(use sticky form concept)                                                                                                                                                     

b) Write Ajax program to carry out validation for username entered  in the textboxIf  thtextboiblank, print ' Enter us ern am e ' . If the  number of characters is less than three, print ' Username is too short '. If the value entered is appropriate the print ' Valid  username '.


Q. 17)

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

b) Write a script to create XML file "Univers ity.xml". The elements details of "University.xml" are as follows:

<Univ>

<Uname>------------ </Uname>

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

<Rank>------------ </Rank>

</U niv>

1)    Store the details of at least 3 universities.

2)    Link the "University.xmI" 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;


Q18)


a)Write a PHP program to create a simple distance calculator that can  accept  distance  in meters  from user. Convert it into centimeters or kilometer according to user preference.

(use radio buttons and Self Processing form) [Marks 15]

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

<?xmI version = " 1.0" ?>

<BookStore>

<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>

</BookStore>

Add more than 5 books details . Display details of book by selecting the publication of book from user.


Q. 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).

Q. 20)

a)Create a XML file which gives details of movies available m "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.

l)  Fibonacci Series.

2) To find sum of the digits of that number.

(Use the concept of self processing page.)


Q. 21)

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

<Course>

<Computer Science>

<Student name>......... </Student nam e>

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

<percentage>........ </percentage>

</Computer Science>

</Co urse>

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.

Q. 22)

a) Create a XML file which gives details of books available rn " Pra ga ti Bookstore" from following categories.

1)  Yoga

2)   Story

3)   Technical

 

and elements in each category are in the fo llowing for mat

<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.                                       

Q. 23)

a)    Create an application that reads "Sports.xml" file into simple XML object. Display attributes and elements. (Hint: Use simple_xml_load_ftleO 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)

Q. 24)

a)  Write a script to create XML file named "College.xml" The element details of "College.xml" are:

<College >

<Cname>------- </Cnam e>

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

<Rank>----- </Rank>

</College>

Display at least 3 colleges Information.                                                                                                  

b)Create a Basic Page in Drupal titled " DepartmentPortal". Add the details abouDepartments  and Teacher details in the page. Also place this page link in the Main Menu.

Q. 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>

<N vehicle>

Also add Type = " Four Wheeler" and its elements                                                                      

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

Q. 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 appro priate 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.


Q. 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_nam e, author, year ,price).




Q. 28)

a)      Write an Ajax program to display list of games stored in an array on clickin g OK  button. 

b) Create a Block in Drupal titled " CollegeSite". The block should  be  displayed  in  the left side of each page. The block should contain announcement about an upcoming eve nt in your college . Also change the theme of your webs ite by follow ing properties:

a)   Change the background colour.

b)  Change the logo image.                                                                                                                      

Q. 29)

a)  Write a PHP script using AJ AX concept, to develop user-friendly and interactive search engine (like a Google search engine)                                                                                                                                                                      [Marks 15]

 

b) Write a PHP Script to create a super class Vehicle having members Company  and  pric e.  Deri ve  2 different classes:

LightMotorVehicle (memhers - mileage)

HeavyMotorVehicle (members - capacity-in-tons).

Define 5 Object of each subclass and display details in table form at 

Q. 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.  Writa  program  to  accept  details  oRectangleSquare  and Triangle and display the area.            [Marks 15]

 

b)   Develop a module  in Dru pal to create  a page showing your contact details (nam e, roll_no, address, and phone ). Also add Navigation on the HomePage called " Contact Details".


Comments