Question: COS1511 JAN/FEB 2021 QUESTION 1 6 marks Complete the statements by providing only the missing words: 1.1 The only way to access a local variable

COS1511 JAN/FEB 2021 QUESTION 1 6 marks Complete the statements by providing only the missing words: 1.1 The only way to access a local variable of a calling function from the function it calls is to use a parameter. (1) ***** 1.2 The only special character allowed in a variable name in C++ is ............... (1) 1.3 A loop construct that is guaranteed to execute at least once is the loop (1) 1.4 An array index in C++ always starts from ............... (1) 1.5 Consider the statement string name = "Joe Soap"; Write the if condition that will check whether the first name in the string is "Joe" or not. (2) QUESTION 2 5 marks State whether the following statements are true or false: (1) 2.1 A variable name in C++ can start with a number. (1) 2.2 The operator to check for equality is = . (1) 2.3 A return statement in a function returns only one value. (1) 2.4 The logical AND operator in C++ is &. (1) 2.5 The last element in a ten element one dimensional array has the index of 9. 5 marks QUESTION 3 (1) 3.1 Name a primitive data type in C++. (1) 3.2 Name a stream manipulator in C++. TURN OVE! (1) 3.3 Add brackets to the following expression to get the answer zero. 2+8/2-5 (1) 3.4 Name a data structure in C++. [TURN OVER]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
