Following are the questions for JS and PHP. Write the answers and submit as lab report.
--------------------------------------------------------------------------------------------
Lab session/works:- JS
- write a JS program to display date and time. [Use Date() object]]
- Write a program to input a number and know that it is an even or odd number. [Use prompt for input and % operator to get remainder]
- Write a program to pick the greatest number among three numbers entered by the user.
- Write a Js program to find the square root of a number.Here the number is entered by the user.[Use Math object with method (Math.sqrt for square root) and prompt method to input data]
- Write a program to input your name and age using form and know whether he/she is eligible to vote or not. [ Use function and onclick event]
- Write a program to input a string using form and convert that into uppercase.[Use string object toUpperCase()]
- Write a program to print 1,3,5,....100 using a while loop. Use function.
- Write a program to reverse a string. [use loop from its length-1 to 0 and print it]
- An array contains some string data. Print them.
- An array contains some data. Print them in reverse order.[use array.reverse() method].
- Write a program to insert a string “We are learning JS” via form object getElementById() method.Use paragraph with id.
- Input your name and grade using form. Validate this with a message ‘This field is required’, onclick.
- Write any two paragraphs in your html page. Now write a program using jquery to hide that written paragraphs as you click on that.
- Use Jquery to create an alert message for a button.
- Use Jquery to show concept of slide effect.[Use slide() method]
PHP:-
- Write a PHP program to find the greatest number among three numbers.
- Write a PHP program to find the smallest number among three numbers.
- Write a PHP program to swap two numbers.
- Write a PHP program to input name and address using form and display them.
- Write a PHP program to input a string through a text box and find its length.[use strlen()]
- Write a PHP program to store some strings in an array and print them.
- Write a PHP program to sort data stored in an array.[use sort() function and print_r() to print.]
- Write a PHP program to know whether two strings are the same or not.
- Write a php program to display your name 100 times.
- Write a PHP program to print a multiplication table of a number.Input the number via form.
- Write a php program to display the factorial value of a number.
- Write a PHP program to connect a database named ‘student’.
- Write a PHP program to insert a record in a database named student with fields id,name and grade.
- Write a PHP program to display all records(previous question) of students who are in grade 11.
- Write a PHP program to delete records of a student whose id is 3.[previous question]
No comments:
Post a Comment