PHP Exam 1
Q1. Create an associative array of 5 elements where index will be country name and value will be the corresponding capital name. Sort the array by capital name and print.
Q2. Write code to create a new text file named book.txt and write the following data into the file,
674-5128884 A byte of Python Swaroop C H
Create a class named BookList which contain isbn, bookName, authorName as properties
and a method named display which will print the isbn no, book name and author name. Use
constructor to initialize the properties using the data of book.txt file.
Q3. Calculate the area of circle using function.
Q4. Calculate the factorial of a number.
Q5. Validate the email address using regular expression.
Write code to create a new text file named book.txt and write the following data into the file,
ReplyDelete674-5128884 A byte of Python Swaroop C H
Create a class named BookList which contain isbn, bookName, authorName as properties
and a method named display which will print the isbn no, book name and author name. Use
constructor to initialize the properties using the data of book.txt file.