Diploma Exam Questions - JavaScript, Advanced Scripting, PHP
UNIT 3: JavaScript (Client-Side Scripting)
1. What is JavaScript? Explain its role in client-side scripting.
2. Differentiate between client-side and server-side scripting.
3. Write a simple JavaScript program to display "Hello World".
4. How do you declare variables in JavaScript? Explain with examples.
5. Explain the data types supported in JavaScript.
6. Write a JavaScript function to calculate the square of a number.
7. What are conditional statements in JavaScript? Explain `if`, `else if`, and `switch`.
8. Explain different types of loops in JavaScript with syntax.
9. What is the purpose of the `while` and `do-while` loop?
10. Write a JavaScript program using a `for` loop to print numbers 1 to 10.
11. How does JavaScript handle events?
12. What are global and local variables in JavaScript?
13. Explain the concept of scope in JavaScript.
14. What is the difference between `==` and `===` in JavaScript?
15. How is JavaScript embedded into HTML?
UNIT 4: Advanced Scripting (JS, DHTML, AJAX, XML)
1. What are JavaScript objects? Explain with an example.
2. List and explain any three built-in JavaScript objects.
3. Explain DOM. How does JavaScript interact with the DOM?
4. What is form validation? Write JavaScript code to validate an email field.
5. What is DHTML? How is it different from HTML?
6. Explain how HTML, CSS, and JavaScript work together in DHTML.
7. Write JavaScript code to handle button click events.
8. What is AJAX? Describe its advantages and disadvantages.
9. Explain the working of an AJAX-based web application.
10. Mention and explain alternatives to AJAX.
11. What is XML? Describe its structure with an example.
12. Explain the uses of XML in web development.
13. What is DTD and how is it used in XML?
14. Explain XSL and XSLT with basic examples.
15. What are Web Services? How are they useful in web applications?
UNIT 5: PHP (Server-Side Scripting)
1. What is PHP? How is it different from JavaScript?
2. Write a simple PHP script to print "Welcome to PHP".
3. How are variables declared in PHP? Mention data types.
4. Explain the concept of arrays in PHP with examples.
5. Write a PHP function to calculate the factorial of a number.
6. How are forms handled in PHP?
7. What are the superglobals `$_GET` and `$_POST` in PHP?
8. Explain how PHP connects to a MySQL database.
9. Write PHP code to create and select a database.
10. How can you insert data into a MySQL table using PHP?
11. Explain how to alter tables in PHP.
12. How can you delete data and tables using PHP?
13. What is PHPMyAdmin? How is it used?
14. List and explain some common database bugs in PHP.
15. What are some security precautions to take when handling forms in PHP?