Chapter 1 Slips
Chapter 1 Slips
Chapter 1 Slips
1. A college has given roll number to each student, The roll number is six digit number where first
two digits are faculty(B.Sc., 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)
2. Write a PHP script to demonstrate the introspection for examining class(use function
get_declared_classes() ,get_class_methods() and get_class_vars()).
3. 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”
4. Create an abstract class Shape with methods calc_area( ) and calc_volume( ). Derive three
classes Sphere(radius) , Cone(radius, height) and Cylinder(radius, height), Calculate area and
volume of all. (Use Method overriding).
5. 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.
6. Write PHP script to demonstrate the concept of introspection for examining object.