T.Y.BSc Computer Science PHP Assignment
PHP Assignment
ASSIGNMENT NO : 1
- Design a form to accept a string.
- Write a Function to count the total number of vowels (a,e,i,o,u) from the string.
- Show the occurrences of each vowel from the string.
- Check whether the given string is a palindrome or not. (Without using build in function)
- Use radio buttons and the concept of function. Use 'include' construct or require statement.
A2. Write a PHP script for the following :
- Design a form to accept two strings from the user.
- Find the first occurrence and last occurrence of the small string in the large string.
- Count the total number of occurrences of small string in the large string.
- Provide a text box to accept string. Which will replace the small string in the large string.
B1. Write a PHP Script for the following:
ASSIGNMENT NO : 2
- Design a form to accept two numbers from the user.
- Give option to choose the arithmetic operation (Use radio buttons.)
- Display the result on the next form.
B2. Write a PHP script for the following :
- Design a form to accept two strings from the user.
- Find whether the small string appearances at the start of the large string.
- Provide a text box to accept the string that will replace all occurrence of small string.
- Also split the large string into separate words.
- Design a form to accept the details of 5 different items such as item code, item name, units sold, rate.
- Display the bill in the tabular format.
- Use only 4 text boxes. (Hint : Use of explode function.)
- Design a form to accept two strings.
- Compare the two strings using both methods (== operator & strcmp function).
- Append second string to the first string.
- Accept position from the user from where the characters from the first string are reversed. (Use radio buttons.)
C3. Using regular expressions check for the validity of entered email-id. The @ symbol should not appear more than once. The dot (.) can appear at most once before @ and at the most twice or at least once after @ symbol. The substring before @ should not begin with a digit or underscore or dot or @ or any other special character. (Use explode and ereg function.)
ASSIGNMENT NO : 2
- Display the elements of an array along with the keys.
- Display the size of an array.
- Delete the element from an array.
- Reverse the order of each element's keys-value pair [Hint: use array_flip()]
- Traverse the elements in an array in random order [Hint: use shuffle()]
C1. Write a menu driven program to perform the following stack and queue related operations : [Hint : use Array_push(), Array_pop(), Array_shift, Array_unshift() ]
- Insert an element in stack.
- Delete an element from stack.
- Display the contents of stack.
- Insert an element in queue.
- Delete an element from queue.
- Display the contents of queue.
C2. Write a menu driven program to perform the following operations on associative arrays:
- Sort the array by values (Changing the keys) in ascending, descending order
- Also sort the array by values without changing the keys.
- Filter the odd element from an array.
- Sort the different arrays at a glance using single function.
- Merge the given arrays.
- Find the intersection of two arrays.
- Find the union of two arrays.
- Find the set difference of two arrays.
ASSIGNMENT NO : 3
- Display the size of file.
- Display Last Access, Changed, Modified time of file.
- Display details about owner and user of file.
- Display type of file.
- Delete a file.
- Copy a file.
- Traverse a directory in hierarchy.
- Remove a directory.
C2. Write a program to read directory name from user and display content of the directory recursively.
ASSIGNMENT NO : 4
A1. Define an
interface which has methods area(), volume(). Define constant PI. Create a
class Cylinder which implements this interface and calculate Area and Volume.
(Hint : Use define())
A2. Write a class
declarations and member function definitions for an employee(code, name,
designation). Derive emp_account(account_no,joining_date) from employee and
emp_sal(basic_pay, earnings, deduction) from emp_account.
Write a menu driven program
Write a menu driven program
- To build a master table.
- To sort all entries.
- To search an entry.
- Display salary.
B1. Create class
rectangle and derive a class square from class Rectangle. Create another class
circle. Create an interface with only one method called 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 square, circle and
rectangle and display the area.
B2. Create a class
account(account,cust_name). Derive two classes from account as
saving_acc(balance,min_account) and current_acc(balance, min_account).
- Display a menu.
- Saving account.
- Current account.
For each of this display a menu with the following options.
- Create account.
- Deposite.
- Withdrawal.
C1. Define an
Interface for stack operation. Implement this interface in a class.
C2. Write a necessary
class and member function definitions for a cricket player object. The program
should accept details from user (max : 10) (Player_code, name, runs,
innings_played, no_of_times_out). The Program should contain menu.
·
Enter details of players.
·
Display average runs of a single player.
·
Average runs of all players.
·
Display the list of players in sorted order as
per runs (Use function overloading)
Bhau are run zalele programs takayche na..����
ReplyDeleteplease display Assignment no.4
ReplyDelete