Local and Global Variables (2 marks)
Explain the difference between local and global variables. Provide an example of each using pseudocode.
Local and Global Variables (2 marks) Read More »
Explain the difference between local and global variables. Provide an example of each using pseudocode.
Local and Global Variables (2 marks) Read More »
Design an algorithm in pseudocode that calculates the factorial of a given non-negative integer n using iteration. The factorial (symbol: !) of a number is the product of all positive integers less than or equal to the number. For example, 5!=5×4×3×2×1=120.
Mathematical Operations and Counts (5 marks) Read More »
What value would the Boolean variable isEven hold if it stores the result of the expression (10 mod 2) == 0? Explain your answer.
Boolean Data Type (2 marks) Read More »
Consider the following pseudo-code segment: var ageAsString = “25” var age = INTEGER(ageAsString) a) What is the data type conversion that is taking place here? (1 mark) b) Explain why this type of conversion might be necessary in a computer program. (3 marks)
Conversion Between Data Types (4 marks) Read More »
Which data type would be most appropriate for the following variables? State the data type and give a reason for your choice: a) temperature (1 mark) b) isStudent (1 mark)
Practical Application of Data Types (2 marks) Read More »
Explain the difference between the following data types: a) integer and real b) string and character
Identify and Explain Data Types (2 marks) Read More »
Explain why it is important for a program to validate user input from the keyboard.
Validating Inputs (2 marks) Read More »
Identify what is meant by the term “input” in the context of computer systems.
What is an Input? (1 mark) Read More »
Explain why meaningful identifier names are important when programming. Provide two reasons in your answer.
Identifiers in Programming (2 marks) Read More »
Explain the purpose of an assignment statement in a computer program.
Variable Assignment (1 Mark) Read More »
Notifications