Integrated revision and exam preparation (Grade 11 IT) – Week 4 focus
Download the Lessonotes Mobile South Africa app for faster lesson access on Android and iPhone.
Subject: Information Technology
Class: Grade 11
Term: Term 4
Week: 4
Theme: General lesson support
This page supports the lesson note with a companion video and a short classroom-ready summary.
For class groups and homework, share this lesson page so learners also get the summary, objectives, and full lesson context.
This week marks a crucial phase in our Grade 11 IT journey: integrated revision and exam preparation. We’ll be consolidating the knowledge and skills acquired throughout the term, focusing on practical application and exam technique. Effective exam preparation is not just about memorization; it's about understanding, applying, and adapting your knowledge to different scenarios. In South Africa, IT skills are increasingly valuable, opening doors to diverse career opportunities in software development, data analysis, cybersecurity, and more. Mastering these concepts now will provide a solid foundation for your future studies and career prospects.
This week's focus is on integrating different concepts from the term. This means we will be tackling problems that require you to use multiple programming constructs, data structures, and database operations simultaneously. 2.1 Integrated Programming Concepts: We'll be focusing on integrating the following concepts: Variables and Data Types: Remember to choose appropriate data types for your variables (Integer, Real, String, Boolean). Understanding data type limitations is crucial for avoiding errors. For example, attempting to store a large number in an Integer variable might result in an overflow error. Conditional Statements (if, else if, else): Use these to control the flow of execution based on conditions. Nested `if` statements can handle complex scenarios. Make sure you understand how to correctly evaluate boolean expressions (e.g., `(x > 5) AND (y highest_score: highest_score = score print(f"The highest score is: {highest_score}") ``` Explanation: We initialize `highest_score` to the first element of the `scores` list. We iterate through the `scores` list using a `for` loop. Inside the loop, we compare the current `score` with `highest_score`. If the current `score` is greater than `highest_score`, we update `highest_score` to the current `score`. After the loop, `highest_score` will contain the highest score in the list. We print the result using an f-string.
Example 3: Database Query (SQL): Assume we have a table called `Students` with columns `StudentID`, `Name`, and `Grade`. `SELECT Name, Grade FROM Students WHERE Grade > 70 ORDER BY Grade DESC;` Explanation: This SQL query selects the `Name` and `Grade` columns from the `Students` table where the `Grade` is greater than
7
0. The results are then ordered in descending order based on the `Grade` column. This query is useful for identifying high-achieving students. Guided Practice (With Solutions)
Question 1: Write a Python function that takes a list of integers as input and returns the sum of all even numbers in the list.
Solution: ```python def sum_even_numbers(numbers): """Calculates the sum of all even numbers in a list.
Args: numbers: A list of integers.
Returns: The sum of all even numbers in the list. """ total = 0 for number in numbers: if number % 2 == 0: # Check if the number is even total += number return total Example usage: numbers = [1, 2, 3, 4, 5, 6] even_sum = sum_even_numbers(numbers) print(f"The sum of even numbers is: {even_sum}") # Output: 12 ```
Commentary: This function demonstrates the use of a `for` loop to iterate through a list and an `if` statement to check for a condition (even number). It also showcases good documentation practices with a docstring.
Question 2: Write a Python function that takes a string as input and returns the number of vowels (a, e, i, o, u) in the string (case-insensitive).
Solution: ```python def count_vowels(text): """Counts the number of vowels in a string (case-insensitive).
Args: text: The input string.
Returns: The number of vowels in the string. """ vowels = "aeiou" count = 0 text = text.lower() # Convert to lowercase for case-insensitive counting for char in text: if char in vowels: count += 1 return count Example usage: text = "Hello World" vowel_count = count_vowels(text) print(f"The number of vowels is: {vowel_count}") # Output: 3 ```
Commentary: This function demonstrates string manipulation (converting to lowercase), iterating through a string, and using the `in` operator to check if a character is a vowel.
Question 3: Consider a database table called `Products` with columns `ProductID`, `Name`, and `Price`. Write an SQL query to find the average price of all products.
Solution: ```sql SELECT AVG(Price) AS AveragePrice FROM Products; ```
Commentary: This SQL query uses the `AVG()` aggregate function to calculate the average price of all products in the `Products` table. The `AS AveragePrice` clause gives an alias to the resulting column. Independent Practice (Questions Only) Write a Python function that takes a list of strings as input and returns a new list containing only the strings that start with a specific letter (e.g., "A"). The function should be case-insensitive. Write a Python program that generates a random number between 1 and 100 and prompts the user to guess the number. The program should provide feedback (e.g., "Too high", "Too low") until the user guesses the correct number. Write a Python function that takes two lists as input and returns a new list containing the elements that are common to both lists. Create a SQL query to retrieve the names of all students whose names begin with the letter 'S' from a table called 'Students' with columns 'StudentID', 'Name', and 'Grade'. Given a table called 'Orders' with columns 'OrderID', 'CustomerID', and 'OrderDate', and a table called 'Customers' with columns 'CustomerID' and 'Name', write a SQL query to retrieve the names of all customers who placed orders in the year 2023.