C++ Structures and Memory Management Questions
C++ Structures and Memory Management Questions
Chapter 1
1. Represent a structure named student will attributes of different types and give the advantages of using
structure. (Scores : 3)
2. Choose the indirection or value at operator used in C++ from the options given below. (Score: 1)
(a) ++ (b) * (c) & (d) +
3. Write the syntax for the following : (Scores: 2)
(a) Declaration of pointer variable in C++.
(b) Dynamic memory allocation in C++.
4. Give the definition of structure data type in C++. Write down the syntax to define a structure in C++. (2)
5. Define the term self-referential structure. Give example. (Scores: 2)
6. Structure within a structure is termed as (Score: 1)
7. Dynamic memory allocation in C++ is done using _______ operator. (Score: 1)
8. In C++, the operator which is used for dynamic memory allocation is ________. (Score: 1)
9. Orphaned memory blocks are undesirable. How can they be avoided ? (Scores: 2)
10. Discuss problems created by memory leaks. (Scores: 2)
11. What is meant by memory leak in programming ? (Scores: 2)
12. Read the following C++ statements and find the output. (Scores: 2)
int ar [ ] = {15, 45, 34, 12, 23};
int * ptr = ar;
cout << * ptr << ‘\t’ ;
cout << * (ptr + 2) ;
13. How will you free the allocated memory? (Score: 1)
14. Define a structure called time to group the hours, minutes and seconds. Also write a statement that
declares two variables current-time and next-time which are of type struct time. (Scores: 2)
15. Read the following C++ statements. (Scores: 2)
int*p, a=5;
p=&a;
(i) What is the specialty of the variable p ?
(ii) What will be the content of p after the execution of second statement ?
16. Write a C++ program to store and print information (name, roll and marks) of a student using structure. 3
17. Write a program in C++ to input the total marks obtained by a group of students in a class and display
them in descending order using pointer. (Scores: 3)
18. Compare Arrays and Structures. (Scores : 3)
19. Compare the aspects of arrays and structures. (Scores : 3)
20. Differentiate between array and structure. (Scores : 3)
21. Run time allocation of memory is triggered by the operator_____ (Score: 1)
22. Represent the names of 12 months as an array of strings. (Scores : 2)
23. A structure can contain another structure. Discuss. (Scores : 2)
24. If 'ptr' is a pointer to the variable 'num', which of the following statements is correct?
(i) 'ptr' & 'num' may be of different data types.
(ii) If 'ptr' points to 'num', then 'num' also points to 'ptr'.
(iii) The statement num = & ptr is valid.
(iv) *ptr will give the value of the variable 'num’. (Score: 1)
25. What is the difference between structure and class? (Scores: 2)
26. State any two differences between static and dynamic memory allocation. (Scores: 2)
27. Name the data structure where memory allocation is done only at the time of execution. (Score: 1)
28. Identify the correct errors in the following code fragment:
Struct
{
int regno:
char name [20];
float mark = 100;
}; (Scores: 2)
29. What is self referential structure? (Score: 2)
30. What is the difference between the two declaration statements given below:
(a) int *ptr = new int (10);
(b) int *ptr = new int [10]; (Score: 2)
31. What is a Pointer in C++? Declare a pointer and initialize with the name of your country.(Score: 3)
32. Define a structure named 'Time' with elements hour, minute and second. (Scores: 2)
33. Read the following C++ code:
int a[5] = {10, 15, 20, 25, 30};
int *p = a;
Write the output of the following statements :
(a) cout <<* (p + 2);
(b) cout << p + 3; (Scores: 2)
34. What are the different memory allocations used in C++? Explain. (Scores: 3)
35. Consider the given structure definition.
struct complex
{
int real;
int imag;
};
(a) Write a C++ statement to create a structure variable.
(b) Write a C++ statement to store the value 15 to the structure member real. (Scores: 2)
36. Write the use of * and & operators used in pointer. (Scores: 2)
37. Distinguish between Array and Structure. (Scores: 3)
38. The__________operator is used to allocate memory location during run time(execution). (Score: 1)
39. What is a pointer variable in C++? Write the syntax or example to declare a pointer variable. (Scores: 2)
40. Write any two differences in static and dynamic memory allocation. (Scores: 2)
41. Write any two features of dynamic memory allocation. (Scores: 2)
42. Define structure. Write any two differences between structure and array. (Scores: 3)
43. Define Nested Structure with an example. (Scores : 2)
44. What is memory leak? (Scores : 2)
45. Compare Array and Structure in table form. (Scores : 3)
46. Which keyword is used to define a structure in C++ ? (Score : 1)
47. What is the use of structure data type in C++ programs ? (Scores : 2)
48. Explain the reason for memory leak in programming. (Scores : 2)
49. Compare static and dynamic memory allocations in C++. (Scores : 3)
50. (i) In C++, define a structure named ‘student’ with rollno, name and mark as its members. (Scores : 1)
(ii) State the advantages of using structures over arrays. (Scores : 2)
51. Compare the two types of memory allocations in C++. (Scores : 3)
52. Structure is a_______data type.
(a) Fundamental
(b) Derived
(c) User defined (Score: 1)
53. Define Structure. (Scores : 2)
54. What is meant by memory leak in C++ Programming ? (Scores : 2)
55. Find and correct error in the program code given below :
int a = 5;
float *p;
p=&a;
cout <<p; (Scores : 2)
56. If int num=5; write C++ statements to declare a pointer variable and store the address of num into it. (2)
57. The keyword used to define structure data type in C++ is__________ (Score: 1)
58. Which of the following operator is used for dynamic memory allocation ?
(a) * (b) & (c) new (d) delete (Score: 1)
59. What is meant by self-referential structure ? (Scores: 2)
60. How does static memory allocation differ from dynamic memory allocation ? (Scores: 2)
61. What is memory leak? (Scores: 2)
62. ________is the keyword to define a structure. (Score : 1)
63. Which operator is used to get the address of a variable in C++? (Score : 1)
64. What is Nested Structure ? (Scores : 2)
65. How will you free the allocated memory in C++? (Scores : 2)
66. Discuss any two reasons for memory leak. (Scores : 2)
67. In C++ ________ operator is used to get the address of a memory location. (Score: 1)
Chapter 2
Chapter 3
Chapter 4
(Scores : 3)
65. List and explain the following tags with two attributes:
(a) <BODY>
(b) <MARQUEE>
(c) <FONT> (Scores : 3)
66. Distinguish between static web page and dynamic web page. (Scores: 3)
67. Explain the two types of communication over the web. (Scores: 2)
68. Write any two attributes used with <BODY> tag and specify their effects in the webpage. (Scores: 2)
69. Name any four text formatting tags in HTML and write down the use of each. (Scores: 4)
70. __________tag is used to include scripting code in an HTML page. (Score : 1)
71. Compare Static and Dynamic Web Pages. (Scores : 3)
72. Classify the following scripting languages into Client side and Server side.
JavaScript, PHP, VBScript, ASP (Scores : 2)
73. Compare container and empty tags in HTML. (Scores : 2)
74. List and explain any four text formatting tags in HTML. (Scores : 2)
75. List any two text formatting tags. (Scores : 2)
76. (a) Write the basic structure of an HTML document. (Scores : 3)
(b) Write the HTML code for the following : (Scores : 2)
(i) To display a scrolling text “welcome to my webpage” with 5 second delay in scrolling.
(ii) To display the text H2SO4.
77. Mention the purpose of 'src' attribute in <IMG> tag. (Scores : 2)
78. Write the basic structure of a HTML document. (Scores : 3)
Chapter 5
3. <DL> tag is used to create definition list in web pages. Write down the other tags used along with this
and mention each of their purpose. (Scores : 2)
4. List down the values of Type attribute used with <INPUT> tag to create any four types of input
control (Scores : 2)
5. Which of the following is used to divide the browser window into different sections ? (Score: 1)
(a) <DIV> (b) <FRAMESET> (c) <FRAME> (d) <FORM>
6. Which of the following is used for creating controls in a form in HTML ? (Score: 1)
(a) <TABLE> (b) <OL> (c) <INPUT> (d) <FRAME>
7. In HTML _______ tag is used to create hyperlink. (Score: 1)
8. The Hyper Reference of <A> is represented by_______attribute. (Score : 1)
9. List the values of Type attribute of <INPUT> tag. (Scores : 2)
10. Name any four attributes of <TD> tag. (Scores : 2)
11. Write the HTML code to display the following list : (Scores : 3)
1. Input devices
• Keyboard
• Mouse
• Scanner
2. Output devices
• Monitor
• Printer
12. Write the HTML code for the following :
13. (a) To create an email hyperlink to dhsekerala@[Link] (1)
(b) To insert a video file video 1.mp4 in the webpage (1)
14. Differentiate between cellspacing and cellpadding. (Scores : 2)
15. Create a table with 5 types of fruit names, use headings as serial number, name and cost (Scores : 5)
16. Create an Ordered list of five fruits numbered using small Roman numerals. (Scores : 5)
17. Rahim wants to connect his webpage to [Link].
Write the tag and attributes required for these. (Scores: 2)
18. Write an HTML code to display a user registration form as shown below: (Scores : 5)
44. What is a hyperlink? Explain about the different types of hyperlinks available in HTML. (Scores: 3)
45. Explain about various kinds of Lists in HTML with example. (Scores: 5)
46. Which attribute of <input> tag is used to make different kinds of controls like Text box, Radio button,
Submit button etc. ? (Score: 1)
47. Write the HTML code to create a web page which includes, the following table. (Scores: 3)
48. List three types of Lists supported by HTML. Explain about them (Scores : 3)
49. Differentiate between internal and external linking in HTML. (Scores : 2)
50. What is graphical hyperlink ? (Scores : 2)
51. <EMBED> tag is used to_________ (Score : 1)
52. Write the two tags associated with <DL> tag and the use of each in making a definition list. (Scores : 2)
53. What is hyper linking in a web page ? Name the tag used for it. (Scores : 2)
54. What is the use of Action attribute in <FORM> tag ? (Scores : 2)
55. Write HTML code to display the following list in a web page.
Higher Secondary Education
• Science group
• Humanities group
• Commerce group (Scores : 3)
56. List any three values provided to Type attribute of <INPUT> tag and specify the use of each. (Scores : 3)
57. What is meant by nesting of <FRAMESET>? Explain its need. (Scores : 3)
58. Write HTML code to create a table in a web page as shown below. (Scores : 5)
59. Explain different tags used with <DL> tag to create definition list. (Scores : 2)
60. List any two attributes of <FORM> tag. (Scores : 2)
61. Write an example for an email link using <A> tag ? (Scores : 2)
62. Compare 'type' attribute of <OL> tag and <UL> tag. (Scores : 3)
63. Explain the use of 'name' attribute in <A> tag. (Scores : 3)
64. List and explain any three attributes of <INPUT> tag in HTML. (Scores : 3)
65. Write the HTML code to create the following table : (Scores : 5)
66. Which attribute is used with <A> tag to specify the name of the web page to be linked ? (Score: 1)
67. The HTML tag used to specify a data item in a definition list in a web page is____________ (Score: 1)
68. Distinguish between Rowspan and Colspan used in the creation of tables in web pages. (Scores: 2)
69. Write an HTML code to create a table as shown below. (Scores: 3)
70. Explain the three types of lists that can be created in HTML documents. Name the tags required for each.
(Scores: 3)
71. __________attribute of <OL> tag enables to change the beginning value of the list. (Score : 1)
72. Link to a particular section of the same document is called__________ (Score : 1)
73. What is the use of <EMBED> tag in HTML? (Scores : 2)
Chapter 6
1. "TRUE AND FALSE are used to represent boolean values." State if the above given statement is correct
or not. (Score: 2)
2. Classify the following values in JavaScript into suitable data types. (Score: 2)
67.4, “true”, false, 0
3. Write any two built in – Functions used in JavaScript. (Score: 2)
4. List any three built-in functions of JavaScript and specify the use of each function. (Scores : 3)
5. Write a for loop in JavaScript to display the numbers from 1 to 10 in a web page. (Scores : 3)
6. Which are the data types in JavaScript ? Write down the keyword used to declare variable in JavaScript. 2
7. Write the names of the following : (Score: 2)
(a) Operator used for adding two strings in JavaScript.
(b) Function used in JavaScript to convert string type data containing numbers to number data type.
8. Explain the use of for loop with an appropriate example. (Scores : 3)
9. Write short note about Data types in JavaScript. (Scores : 3)
10. Briefly explain about any two control structures in JavaScript. (Scores : 3)
11. Discuss about different ways of adding JavaScripts to a webpage. (Scores : 3)
12. Name the following : (Scores : 3)
(a) Built-in function used in JavaScript to get the character at a particular position in a string.
(b) Built-in function in JavaScript used to check whether a value is number or not.
(c) Data type used in JavaScript for representing true or false values.
13. Write the uses of the following built in functions in JavaScript : (Scores : 3)
(a) typeof( )
(b) isNaN( )
(c) charAt( )
14. Consider the following JavaScript code to find the sum of numbers upto a given limit. (Scores : 3)
Fill the blanks.
_________ sumLimit( )
{
_________ sum = 0, i, limit;
limit =
_________ (document. [Link]. _________);
_________ (i = 1; i <= limit; i++)
sum += i;
[Link]. _________ = sum;
}
15. Develop a webpage that implements a JavaScript function that takes two numbers as input and displays
their product. (Scores: 2)
16. Give the function in JavaScript that converts a string type data containing numbers to number type.
(Score: 1)
17. Design a web page with form tag which accepts a number in a textbox and another textbox which should
display either odd or even. Write a function in JavaScript to check whether the number is odd or even. (2)
18. Develop a web page that accepts a number after validation and prints the factorial of it. (Scores: 2)
19. JavaScript provide a large number of built-in functions.
a) Name any two of them with an example. (Scores : 2)
b) The property which returns the size of the string is (Score: 1)
20. A virtual machine for executing JavaScript code is_____ (Score: 1)
21. Discuss about six built in functions used in JavaScript. (Scores : 3)
22. Design a procedure in JavaScript that takes two strings as input and displays the concatenated strings as
output. (Scores: 2)
23. State whether the following statements are true or false :
(a) JavaScript is the only client side scripting language. (Score: 1)
(b) JavaScript is a case sensitive scripting language . (Score: 1)
(c) The keyword used to declare a variable in JavaScript is VAR. (Score: 1)
24. The following code in HTML will call the Show Message () in JavaScript.
<input type="button" value="show" onClick="ShowMessage ();">
Modify the code to call the ShowMessage() when :
(a) User moves the mouse over the button.
(b) User presses any key on the keyboard. (Scores : 2)
25. Consider two strings "Education is the most powerful weapon" and "you can use to change the world".
Write JavaScript code to : (Scores : 2)
(a) Store these strings in two variables.
(b) Combine the two string variables.
26. Predict the output of the following code :
<HTML>
<BODY>
<SCRIPT Language="JavaScript">
var i, s=0);
for (i=1; i <=10; i+=2)
s +=i;
[Link]("sum = " +s);
</SCRIPT>
</BODY>
</HTML> (Scores: 2)
27. Identify suitable JavaScript data types for the following:
(a) "super computer"
(b) "true"
(c) 67.5 (Scores: 3)
28. Write the JavaScript code to display "Welcome to Kerala" inside the <h1>, tag as shown in the HTML
page.
<HTML>
<Body>
<Script lang="javascript">
<h1>.….</h1>
</Body>
</script>
</HTML> (Score: 2)
29. Consider a string "Gandhiji". Write JavaScript code fragment to do the following tasks.
(a) Convert the string to upper case.
(b) Find the length of the string.
(c) Display the 3rd letter in the string. (Score: 3)
30. Explain the two purpose of '+' operator used in JavaScript. (Scores: 2)
31. Explain any two data types in JavaScript. (Score: 2)
32. In client side scripting, processing is done by___________ (Score: 1)
33. Briefly explain the different ways in which a JavaScript code can be inserted in a web page. (Scores: 3)
34. Write JavaScript statements for storing an integer value to a variable. (Scores: 2)
35. Write the names and their use of any two built-in-functions in JavaScript. (Scores: 2)
36. Explain about any two control structures used in JavaScript with example. (Scores: 3)
37. Write JavaScript statements to create a number and string variables. (Scores: 2)
38. Briefly explain about any two built-in functions available in JavaScript. (Scores: 2)
39. What are the different control structures used in JavaScript ? Explain any one with an example. (3)
40. The JavaScript function given below is used to display the sum of digits of a given number. Fill in the
blanks to complete the function.
<Script language="JavaScript">
___________sum digit()
{ var n, s;
n = [Link].txt1._________
for (s = 0;_______; n = n/10)
s= s+____________;
[Link]=s;
}
</script> (Scores: 2)
41. What are the data types in JavaScript ? (Scores : 2)
42. Write any four comparison operators in JavaScript. (Scores : 2)
43. What are the mouse events in JavaScript ? Explain. (Scores : 3)
44. How will you declare a variable in JavaScript ? Give an example. (Scores : 2)
45. Write a JavaScript code to display the numbers from 1 to 100. (Scores : 2)
46. List three data types in JavaScript and give example for each. (Scores : 3)
47. Explain the working of the following JavaScript functions and specify the output of each.
(a) isNaN("254")
(b) "Covid-19".charAt(3)
(c) "MASK".toUpperCase() (Scores : 3)
48. Classify the following values in Java script into suitable data types ?
(27.4, false, "true", 25) (Scores : 2)
49. Write the uses of '+' operator in Java script. (Scores : 2)
50. Write the syntax of any three built-in functions in Java script. (Scores : 3)
51. Name the keyword used to declare a variable in JavaScript. (Score: 1)
52. Which of the following data is represented by Boolean data type in JavaScript ?
(a) 1 (b) TRUE
(c) "true" (d) true (Score: 1)
53. Write down the use of any two built-in functions in JavaScript with the help of examples.
(Scores: 2)
54. Write a JavaScript code to display the sum of the first 100 natural numbers. (Scores: 3)
55. The keyword used to declare a variable in JavaScript is_____________ (Score : 1)
56. Write the syntax and use of any two built-in functions used in JavaScript. (Scores : 2)
57. Compare 'OnKeyDown' and 'OnKeyUp' events of JavaScript. (Scores : 3)
Chapter 7
Chapter 8
15. Classify the following operations in relational algebra into unary and binary operations :
(1) UNION (2) SELECT (3) SET DIFFERENCE (4) PROJECT (Score: 1)
16. Explain about SELECT, INTERSECTION and SET DIFFERENCE operations with example. (3)
17. Discuss advantages of DBMS. (Scores : 3)
18. Create a database schema for the relation VEHICLE. (Scores : 2)
19. _________in a table gives the complete data of a particular entity.
(a) Tuple (b) Attribute
(c) Domain (d) Schema (Score: 1)
20. In the ACCOUNT relation shown below
32. Explain about UNION, INTERSECTION and SET DIFFERENCE operations in Relational Algebra.
(Scores: 3)
33. List any four advantages of DBMS. (Scores: 2)
34. Distinguish between the terms degree and cardinality used in RDBMS. (Scores: 2)
35. Consider the following relations :
Arts relation :
Adm no. Name Batch
3001 Manju Al
3009 Cristy C1
4010 Fazil B1
3090 Arun K2
Sports relation :
Adm no. Name Batch
4015 Arjun Bl
4010 Fazil B1
3005 Fathima C2
(a) Explain UNION operation with the help of the above two tables. (Scores : 2)
(b) What will be the result if INTERSECTION operation is performed on these tables ? (Scores : 2)
(c) Which operation is to be performed to get the list of students in Football from class 12A ? (Score : 1)
43. Who are the users of a data base ? (Scores : 2)
44. List any four advantages of DBMS. (Scores : 2)
45. Explain the different levels of data abstraction in DBMS ? (Scores : 3)
46. Define the following RDBMS terms:
(a) Degree (b) Cardinality (Scores : 2)
47. List and explain any two relational algebra operations. (Scores : 3)
48. The level of data abstraction in DBMS that is closest to the user is known as__________
(a) Physical level (b) Logical level
(c) View level (d) Conceptual level (Score: 1)
49. If a table STUDENT has 5 columns and another table TEACHER has 3 columns, the Cartesian product
STUDENT X TEACHER will have_____________columns. (Score: 1)
50. Explain any four advantages of DBMS. (Scores: 4)
51. List the four components of DBMS. (Scores: 2)
52. A_________ key is set of one or more attributes that can uniquely identify tuples within the relation.
(Score : 1)
53. Abstraction of the database can be viewed as__________levels.
(a) two levels (b) four levels
(c) one level (d) three levels (Score : 1)
54. List any four advantages of DBMS over conventional file system. (Scores : 2)
55. Discuss the following RDBMS terms:
(i) Tuple
(ii) Cardinality (Scores : 2)
56. Explain any two relational algebra operations. (Scores : 2)
Chapter 9
1. Give the correct syntax of the queries in SQL for the following:
(a) Renaming a table
(b) Deleting rows from a table
(c) Changing definition of a column
(d) Removing columns from a table
(e) Adding a new column (Scores : 5)
2. Identify the essential clause used with SELECT command in SQL. (Score: 1)
(a) FROM (b) WHERE (c) ORDER BY (d) GROUP BY
3. Give the output obtained with the pattern match "---" in the string "board". (Score: 1)
4. Briefly explain any three aggregate or column functions in SQL. (Scores : 3)
5. List any three column constraints of SQL and mention each of their purpose. (Scores : 3)
6. Assume that Employee is a table with the column names Emp_Code, Emp_Name, Designation and
Salary. Write SQL statements for the following : (Scores : 3)
(a) Display the details of all employees.
(b) Show the details of employees with salary 30000 and above.
(c) Find the number of employees whose designation is “Programmer”.
7. Write SQL queries for the following : (Scores : 3)
(a) To create a table with the following fields
Employee name
Designation
Basic pay
DA
Gross pay
(b) To display all employees whose Basic pay is more than 50,000.
(c) To update the DA of employees whose designation is manager to 20% of Basic pay.
8. The full form of DML is _________. (Score: 1)
9. What happens when we use DELETE FROM command without A WHERE clause ? (Score: 1)
10. If a table named "mark" has field's reg_No. Sub_Code and marks write SQL statements for the following:
(a) List the subject codes eliminating duplicates.
(b) List the marks obtained by students with subject codes 3001 and 3002.
(c) Arrange the table based on marks for each subject.
(d) List all the students who have obtained marks above 90 for the subject codes 3001 and 3002.
(e) List the contents of the table in the descending order of marks. (Scores : 5)
11. Distinguish between DDL and DML and give examples for each type. (Scores : 5)
12. Null values in tables are specified as "null". State whether true or false. (Score: 1)
13. Classify the following commands into DDL, DML and DCL in SQL : (Scores : 2)
Delete, Drop, Restore, Update
14. Write the differences between WHERE and HAVING clauses in SQL. (Scores : 2)
15. Which command is used to delete the table?
(a) delete from (b) drop table
(c) delete table (d) drop view (Score: 1)
16. Differentiate between CHAR and VARCHAR data types in SQL. (Scores : 3)
17. Explain any three aggregate functions in SQL. (Scores : 3)
18. Write short note about data types in SQL. (Scores : 3)
19. Name the most appropriate SQL data type required to store the following data :
32. Write SQL queries based on the table PRODUCT given below:
Chapter 10
1. PHP is
(a) freeware
(b) proprietary
(c) both
(d) none (Score: 1)
2. Compare Indexed and associative arrays in PHP. (Score: 2)
3. Write a PHP program to display prime numbers below 50. (Scores : 3)
4. Explain the two types of arrays used in PHP. Give example for each type. (Scores : 3)
5. Explain briefly about any three core data types in PHP. (Scores : 3)
6. (i) In PHP, which symbol is used to begin a variable name ? (1)
(ii) What are the differences between echo and print in PHP ? (2)
7. Briefly explain about operators in PHP. (Scores : 3)
8. Write a PHP program to display the perfect numbers below 100. (Scores : 3)
9. An array in PHP is given as follows:
$family = array ("Father"=>"Ajay","Son"=>"Arjun", "Daughter"=>" "Archana");
Name the type of this array. Write a foreach loop that prints all the array elements. (Scores : 2)
10. What are the difference between GET and POST methods in form submitting? (Score: 2)
11. A web server that supports PHP on any operating system is_______ (Score: 1)
12. Discuss about special data types used in PHP. (Scores : 2)
13. Create an HTML form in PHP showing the difference of the GET and POST method. (Scores : 3)
14. Write a function in PHP to find the factorial of a number. (Scores : 3)
15. Write a PHP program to find the biggest of three numbers. (Scores : 3)
16. Study the following steps and determine the correct order :
(1) Open a connection to MySQL server
(2)Execute the SQL query
(3)Fetch the data from query
(4)Select database
(5) Close connection
(a) 4, 1, 2, 3, 5
(b)1, 4, 2, 3, 5
(c) 1, 5, 4, 2, 3
(d) 4, 1, 3, 2, 5 (Score: 1)
17. What are the differences between "echo" and "print" statements ? (Scores: 2)
18. What is the expansion of LAMP ? (Scores : 1)
19. Name the global variables used for passing data using HTTP GET and POST requests.(Scores: 2)
20. What is the difference between echo and print in PHP ? (Scores: 3)
21. Write the output of the following PHP code fragment.
function justAfun ($num)
{
$num $num * 5+ ($num + 6);
return $num;
}
echo justAfun(100); (Score: 2)
22. Name the different types of arrays in PHP. Explain with an example. (Score: 3)
23. In PHP, arrays that use string keys are called_______ (Score: 1)
24. List the core data types in PHP. (Scores: 2)
25. Write PHP code to display all even numbers below 100. (Scores: 3)
26. In PHP, the name of a variable starts with__________sign. (Score: 1)
27. Differentiate echo and print statements used in PHP. (Scores: 2)
28. Prepare a short note about different Data types used in PHP. (Scores: 3)
29. Differentiate echo and print used in PHP. (Scores: 2)
30. Differentiate indexed and associative arrays in PHP. (Scores: 3)
31. Expand LAMP. (Score : 1)
32. Compare PHP keywords 'echo' and 'print' in table form. (Scores : 2)
33. Describe three tier architecture of PHP. (Scores : 3)
34. Name the PHP operator to join two strings. (Score : 1)
35. Write the syntax of for loop in PHP and explain its working. (Scores : 3)
36. Explain two types of arrays in PHP. (Scores : 3)
37. PHP stands for________ (Score: 1)
38. Compare echo and print commands in PHP with suitable examples. (Scores : 3)
39. Write the uses of any three string functions in PHP with syntax. (Scores : 3)
40. The PHP operator used to join two strings is________. (Score: 1)
41. Variable in PHP begin with_________character. (Score: 1)
42. Compare echo() and print () functions in PHP. (Scores: 2)
43. Write any two string functions in PHP and their uses. (Scores: 2)
44. The dot(.) operator is used for__________operation in PHP. (Score : 1)
45. In PHP, a variable name starts with the___________sign. (Score : 1)
46. What are the differences between 'Echo' and 'Print' statements ? (Scores : 2)
47. List PHP Core data types. (Scores : 2)
Chapter 11
1. The computing technology in which a problem is broken into pieces and solved concurrently is
called____________ (Scores : 1)
2. Categorize the cloud service models. (Scores : 3)
3. Define Robotics. (Score: 1)
4. Give any three advantages and disadvantages of grid computing. (Scores : 3)
5. A widely used operating system for cluster computers is _________ (Score: 1)
6. Discuss advantages of grid computing, cluster computing and cloud computing. (Scores : 3)
7. NLP is ________.
(a) National Level Programming
(b) Natural Language Processing
(c) Neural Level Programming
(d) None of the above (Score:1)
8. What is ANN ? (Scores : 3)
9. What is Artificial Neural Networks? (Scores: 2)
10. Differentiate serial computing and parallel computing. (Scores: 2)
11. Briefly explain any two applications of computational intelligence. (Scores: 2)
12. Briefly explain different types of cloud services. (Scores: 3)
13. Compare serial and parallel computing. (Score: 2)
14. Write any two advantages of parallel computing. (Score: 2)
15. Write short note on cloud computing. (Score: 2)
16. Differentiate between serial and parallel computing. (Score: 2)
17. List any four applications of computational intelligence. (Score: 2)
18. Briefly explain any three application of computational intelligence. (Score: 3)
19. Explain the cloud service models. (Scores: 3)
20. List any four applications of computational intelligence. (Scores: 2)
21. Distinguish between parallel computing and serial computing. (Scores: 2)
22. Explain the advantages and disadvantages of cloud computing. (Scores: 3)
23. Write short note about any two applications of computational intelligence. (Scores: 2)
24. What is cloud computing ? Write any two services offered by cloud. (Scores: 3)
25. What are the advantages of distributed computing ? (Scores : 2)
26. Compare Serial Computing and Parallel Computing. (Scores : 3)
27. Name the application of computational intelligence that refers to metrics related to human characteristics
and traits. (Score : 1)
28. Write a brief note on three services of cloud computing. (Scores : 3)
29. The study of control and communication between man and machine is called________(Score: 1)
30. Write a short note on any three cloud computing services. (Scores : 3)
31. Distinguish between serial computing and parallel computing. (Scores: 2)
32. Briefly describe the three cloud service models. (Scores: 3)
33. Prepare short note on cluster computing. (Scores: 2)
34. Write any two advantages of grid computing. (Scores: 2)
35. What is Cloud Computing ? Write any two advantages of Cloud Computing. (Scores : 2)
36. What is meant by cloud computing ? Which are the three categories of cloud services ? (Scores: 2)
37. Compare 'Serial Computing' and 'Parallel Computing'. (Scores : 3)
38. Briefly explain any four applications of Computational Intelligence. (Scores : 4)
Chapter 12
Arrays are collections of elements of the same type stored adjacently in memory, ideal for situations where the exact number of items is known and operations are uniform. Structures, on the other hand, can hold multiple data types under a single entity, making them suitable for representing complex entities with multiple attributes. Arrays are limited to single data types and fixed sizes, while structures are more versatile and allow for user-defined data types .
A nested structure is a structure within another structure, allowing for modularity and organization of complex data. For example, struct Address { string city; int zipcode; }; struct Employee { string name; Address addr; }; Here, Address is nested within Employee, enabling structured representation of an employee's details along with their address .
Structures provide a way to group different data types under a single entity, which is beneficial for modeling real-world entities with multiple attributes, such as a student with a name and marks. In contrast, arrays can only store elements of the same type and are less suited to representing heterogeneous data. Structures offer a more flexible and comprehensive data representation .
A memory leak occurs when a program allocates memory by dynamic allocation and fails to deallocate it after use, leading to waste of memory resources. Memory leaks can degrade performance over time by consuming available memory, potentially causing system slowdowns or crashes due to exhaustion of available memory .
Declaring a pointer variable allocates memory for storing a memory address, not the data itself. Common pitfalls include uninitialized pointers leading to undefined behavior, dereferencing nullptr causing segmentation faults, and failing to properly deallocate dynamically allocated memory resulting in leaks. Proper initialization and usage of pointers are crucial to program stability .
Static memory allocation occurs at compile time, whereas dynamic memory allocation happens at runtime, allowing for flexible memory management according to program needs. Dynamic memory allocation using 'new' and 'delete' operators can efficiently use memory by allocating and deallocating as needed during runtime, which is beneficial when the size requirement is not known ahead of time .
Pointers store memory addresses and allow for dynamic memory management and manipulation. The '*' operator is used to access or modify the value at the memory address a pointer refers to, while '&' provides the address of a variable. These operations enable efficient data manipulation and memory uses in scenarios like arrays, linked lists, and dynamic memory allocation .
A self-referential structure is a structure that includes a pointer to an instance of the same structure type within it. This is commonly used in linked list implementations where each node contains data and a pointer to the next node in the list. Example: struct Node { int data; Node* next; }; .
To prevent orphaned memory blocks and memory leaks, developers should ensure that every 'new' allocation is paired with a 'delete'. Use of smart pointers from C++11, such as std::unique_ptr or std::shared_ptr, can automate and manage memory deallocation, thus reducing manual errors .
The 'new' operator allocates memory at runtime from the heap, whereas the 'delete' operator deallocates memory, freeing it back to the system. Example: int *p = new int; This allocates memory for an integer. delete p; This deallocates the memory pointed to by p, preventing memory leaks .