Not Equal Relational Operator (1 mark)
Identify which relational operator would be used in a program to determine if a variable x has a value that is not equal to 10.
Not Equal Relational Operator (1 mark) Read More »
Identify which relational operator would be used in a program to determine if a variable x has a value that is not equal to 10.
Not Equal Relational Operator (1 mark) Read More »
If a variable totalCost is ‘75.5’ and numberOfItems is ‘7’, write the pseudocode to calculate the average cost per item. Explain how real division is used in your pseudocode.
Real Division (4 marks) Read More »
Given two integer variables, ‘dividend’ being 25 and ‘divisor’ being 4, write the pseudocode to calculate and output both the result of the integer division and the remainder.
Integer Division (3 marks) Read More »
Write a pseudocode statement that assigns the product of two variables, length and width, to a new variable called ‘area’.
Arithmetic Operations (1 mark) Read More »
Given the string s = “ComputerScience”, explain what s.substring(3,6) would output. In this question the string manipulation method .substring(x , i) should be interpreted as: x is starting index, i is number of characters, index begins at 0)
Substrings (3 marks) Read More »
Consider the variables firstName storing “John” and lastName storing “Smith”. Write a line of code in either OCR’s ERL or a high level language of your choice, to concatenate firstName and lastName with a space between them and store the result in a new variable fullName.
String Concatenation (2 marks) Read More »
Explain the result of the Boolean expression (NOT A AND B) OR (A AND NOT B) where A = True and B = False.
Boolean Logic. (2 marks) Read More »
Given the expression: 9 * (3 + x) > 50 a) What is the role of the parentheses in this expression? b) Explain what this expression represents. c) List the operators used in this expression.
Operators and Expressions. (3 marks) Read More »
Study the code below: 001 number1 = 3 002 number2 = 5 003 number3 = 7 004 if (number1 > number2) AND (number2 > number3): 005 print(number1, “is the bigger number”) The algorithm above has two different types of operator on line 004. State the names of each type of operator
Operations and String Methods 3 Read More »
Programming languages have many inbuilt string manipulation methods. State the output of the following algorithm and explain your answer fully. 001 name = “Elon Musk” 002 subName = name.subString(5, 4) 003 print(subName)
Operations and String Methods 2 Read More »
Notifications