0% found this document useful (0 votes)
120 views3 pages

Scripting Language Exam Questions

This document provides information about a scripting language exam for a 4th semester bachelor's degree in computer applications. It includes details like the course title, code number, semester, full and pass marks, and duration of the exam. The exam contains 3 sections - Group A with 10 multiple choice questions worth 1 mark each, Group B with 6 long answer questions worth 5 marks each, and Group C with 2 long answer questions worth 10 marks each. The document provides samples of the different types of questions that will be asked. The total marks for the exam are 60, with a pass mark of 24. Candidates are required to answer the questions in their own words as much as possible.

Uploaded by

mAnY iN OnE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views3 pages

Scripting Language Exam Questions

This document provides information about a scripting language exam for a 4th semester bachelor's degree in computer applications. It includes details like the course title, code number, semester, full and pass marks, and duration of the exam. The exam contains 3 sections - Group A with 10 multiple choice questions worth 1 mark each, Group B with 6 long answer questions worth 5 marks each, and Group C with 2 long answer questions worth 10 marks each. The document provides samples of the different types of questions that will be asked. The total marks for the exam are 60, with a pass mark of 24. Candidates are required to answer the questions in their own words as much as possible.

Uploaded by

mAnY iN OnE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Bachelor in Computer Applications Full Marks: 60

Course Title: Scripting Language Pass Marks: 24


Code No: CACS 254 Time: 3 hours
Semester: 4th

Symbol No:
Candidates are required to answer the questions in their own words as far as possible.
Group A
Attempt all the questions. 101 = 10
Circle (O) the correct answer.
1. Which tag is used to check JavaScript enable state,
a) <checkscript> b) <script>
c) <noscript> d) <javascript>
2. Which of following function return 1 when output is successful?

a) echo ( ) c) both
b) print ( ) d) None
3. Which one of the following variable cannot be used inside a static method?

a) $this c) $set
b) $get d) $date
4. $.foo() is equivalent to ?

a) [Link](); c) [Link]();
b) [Link](); d) none of the above

5. Which of the following function is used to sort an array in descending order in PHP?

a) sort(); c) rsort();
b) asort (); d) dsort ();

6. Which clause is used to “modify the existing filed of the table”?


a) ALTER c) SELECT
b) FROM d) MODIFY
7. What is the name of configuration file in WordPress?
a) [Link] c) [Link]
b) [Link] d) [Link]

8. If your object must inherit behavior from a number of sources you must use a/an

a) Interface c) Abstract class


b) Object d) Static class
9. What will be the output of the following JavaScript code?

var a = 10;
do {
a += 1;
[Link] (a);
} while (a < 5);

a) 11121314 c) 12345
b) 1112 d) 11

10. Which one of the following PHP functions can be used to build a function that accepts any number of
arguments?
i. func_get_argv() iii. get_argv()
ii. func_get_argc() iv. get_argc()
Bachelor in Computer Applications Full Marks: 60
Course Title: Scripting Language Pass Marks: 24
Code No: CACS 254 Time: 3 hours
Semester: 4th

Candidates are required to answer the questions in their own words as far as possible.

Group B
Attempt any SIX questions. [65 = 30]
11. What is difference between array and object in JavaScript? Write a JS program to create custom object
[1 + 4]
12. Explain XMLHTTPRequest? Write code to display phone number from database using Ajax? [5]
13. What is JavaScript Object? Describe different properties and methods associated
with DOM object. [1 + 4]
14. What is cookie? Explain how can we store and destroy cookie using PHP? [1 + 4]
15. What is CMS? What are advantage and disadvantage of CMS? [5]
16. List and explain super global variable? Differentiate between GET and POST method. [5]
17. What is framework, Describe How MVC framework work in PHP? [5]
Group C
Attempt any TWO questions. [210 = 20]

18. Write a program to insert student information and delete data from database using PHP? [5 + 5]
20. What is Exception Handling? Describe 4 major principles of object oriented programming with PHP.
[2+8]
21. What is the need of client side scripting? Why need from validation into website, which validation is
best among client side and server side validation describe with examples. [2+8]

Common questions

Powered by AI

The MVC (Model-View-Controller) framework in PHP development serves to separate the application logic, user interface, and control flow, providing organized code that is easier to manage and maintain . The Model represents the data and business logic of the application, interacting with the database to manage data. The View is responsible for displaying data to the user, and the Controller handles user input, processes it as required by the Model, and updates the View . This separation allows developers to work on individual components concurrently and enhances the extendability and scalability of the application .

The XMLHttpRequest object enables asynchronous communication to a server, sending requests and retrieving server responses without reloading the web page, thus making applications faster and more dynamic . A simple example to display a phone number could involve creating an instance of XMLHttpRequest, defining a callback function, and configuring a 'GET' request to a URL endpoint. For example: `var xhr = new XMLHttpRequest(); xhr.open('GET', '/api/getPhoneNumber', true); xhr.onload = function() { if (xhr.status === 200) { document.getElementById('phoneNumber').innerText = xhr.responseText; } }; xhr.send();` This code snippet assumes an endpoint `/api/getPhoneNumber` which returns a phone number from the database .

The ALTER clause in SQL is utilized to make modifications to an existing database table's structure. This includes renaming, adding, or deleting columns, as well as changing column or constraint definitions . For instance, to add a new column called `email` to an existing table `users`, the SQL query would be `ALTER TABLE users ADD email VARCHAR(255);` . To modify an existing field's data type, the command could be `ALTER TABLE users MODIFY COLUMN username VARCHAR(150);` which adjusts the `username` field's data type and length . These modifications help in keeping the database schema aligned with application needs.

Arrays in JavaScript are ordered collections of data elements, typically indexed by numbers, and are used for storing list-like objects. They come with built-in methods to manipulate the elements such as push, pop, and slice . Objects, on the other hand, are collections of key-value pairs where keys can be strings or symbols, making it perfect for representing more complex entities like a person with name and age properties . A custom object can be created using a constructor function or the `Object.create()` method, defining attributes directly within the object. For example: `function Person(name, age) { this.name = name; this.age = age; } var student = new Person('John', 25);` .

Client-side scripting enhances user interaction and can provide immediate feedback and validate inputs before sending data to the server, thereby reducing server load and improving user experience . Form validation should be implemented on both the client and server sides for security and efficiency. Client-side validation with JavaScript helps catch errors early using regular expressions or HTML5 attributes like 'required', 'pattern'. A simple example is `<input type='email' required>` which checks for valid email inputs immediately . On the other hand, server-side validation is crucial for security as client-side validation can be bypassed; it checks the data again once it reaches the server to prevent malicious input . Combining both provides robust protection against erroneous and malicious inputs.

Cookies in PHP are managed using the `setcookie()` function to define a cookie and its parameters like name, value, expiration, and path, and to delete a cookie, you set its expiration date to the past . For example, setting a cookie can be done with `setcookie('user', 'John Doe', time() + (86400 * 30), '/');` to set a cookie named 'user' with the value 'John Doe' that expires in 30 days . To destroy this cookie, use `setcookie('user', '', time() - 3600, '/');` which functions by just setting a past expiry date . These cookies are stored client-side and sent back to the server with every HTTP request to track or identify returning users.

Exception handling in PHP is a mechanism to manage errors gracefully without crashing the program. It involves using 'try', 'catch', and 'finally' blocks to intercept exceptions and manage them appropriately. For example, a 'try' block executes code that might generate an exception, while 'catch' handles the exception . The four major principles of OOP are encapsulation, abstraction, inheritance, and polymorphism. Encapsulation restricts access to certain components, e.g., protecting variables with getter and setter methods. Abstraction simplifies complex reality by modeling classes based on the essential properties. Inheritance allows a class to inherit properties from a parent class, exemplified in PHP using the 'extends' keyword, while polymorphism lets methods do different things based on the object it is acting upon, often achieved using method overriding .

A JavaScript object is a standalone entity, consisting of key-value pairs, where keys are strings or symbols, and values can be of any data type, allowing for the representation of complex entities . DOM (Document Object Model) objects contain properties that represent elements in an HTML document, such as `document.body` which refers to the `<body>` of the document. Key methods include `getElementById()` for accessing elements by their ID, `createElement()` for creating new elements, and `appendChild()` which appends a node as the last child of a specified parent node . These methods enable dynamic interaction with web page elements, allowing for real-time updates without requiring a page reload .

Super global variables in PHP are built-in variables that are always accessible, regardless of scope, and include arrays like $_GET, $_POST, $_SERVER, and $_SESSION, which store information from forms, server environment, and session details . The GET method appends data to the URL, thus exposing it, and is suitable for retrieving data, while the POST method sends data in the HTTP request body, which is not visible in the URL, making it more secure for sensitive data transmission . GET is limited by URL length, whereas POST is not, hence it's preferred for submitting large amounts of data .

A Content Management System (CMS) offers several advantages, such as simplifying the process of content creation and management without requiring extensive technical knowledge, thus allowing users with limited technical skills to update and manage websites efficiently . It provides themes and plugins for customization and functionality extension, and enables content collaboration among multiple users with varied roles . On the downside, CMS platforms can be vulnerable to security exploits, often requiring regular updates and maintenance . They might also have limitations in flexibility compared to custom-built sites, as you have to work within the framework and restrictions of the CMS .

You might also like