Search CSNewbs
304 results found with an empty search
- Download Greenfoot | CSNewbs
A tutorial to understand how to create a game in Greenfoot. A simple step-by-step guide and walkthrough featuring all code needed for the Eduqas GCSE 2016 specification. Installing Greenfoot Greenfoot Home According to the Eduqas 2016 specification exam students will use version 2.4.2 of Greenfoot in the Component 2 exam . Eduqas GCSE students should practice using version 2.4.2 - despite the most up-to-date version currently being 3.6.1. If you are not learning Greenfoot for the Eduqas GCSE then you may wish to download and use the most current version. Eduqas 2016 Specification Students Other Students The version used in the Component 2 exam is 'Greenfoot version 2.4.2 '. Scroll down to 2.4.2 on the old download page and select the correct version for your computer. Windows systems should use the 'For Windows ' option. If you are not following the Eduqas 2016 specification then you should download the most up-to-date version of Greenfoot. Select the correct version for your computer at the top of the download page .
- 8.3 - Writing Algorithms - Eduqas GCSE (2020 Spec) | CSNewbs
Learn about how to write algorithms, including pseudocode and the different flowchart symbols. Based on the 2020 Eduqas (WJEC) GCSE specification. 8.3: Writing Algorithms Exam Board: Eduqas / WJEC Specification: 2020 + Pseudocode Reminder Generally, pseudocode can be written in any way that is readable and clearly shows its purpose. However, the Eduqas exam board advises that pseudocode for the programming exam should follow the conventions below : Annotation { Write your comment in curly brackets} Define data type price is integer firstname is string Declare a variable's value set price = 100 set firstname = "Marcella" Input / output output "Please enter your first name" input firstname Selection (must have indentation) if firstname = "Steven" then output "Hello" + firstname elif firstname = "Steve" then output "Please use full name" else output "Who are you?" end if Iteration (while loop) while firstname ! = "Steven" output "Guess my name." input firstname repeat Iteration (for loop) for i in range 10 input item next i Define a subroutine Declare Sub1 [Subroutine content indented] End Sub1 Call a subroutine call Sub1 Writing Algorithms In an exam you may be asked to write an algorithm using pseudocode . Previous exams have offered up to 10 marks for a single algorithm . While this may seem daunting, it means you can still gain marks for an incomplete program , so don't leave it blank no matter what! You must decompose the problem and break it down into more manageable chunks . Here's an example question : “A teacher is marking tests. Write an algorithm that allows the teacher to input the number of tests to mark and then the mark of each test. Output the average mark, highest mark and lowest mark. The tests are marked out of 100.” This specific algorithm can be broken down into pre-code and three main parts : Part 0: Declare and assign variables. Part 1: Input the number of tests to mark. Part 2: Input the mark of each test. Part 3: Output the average, lowest and highest marks. Part 0: Variables Read the question carefully and work out the variables you will need in your algorithm. I have highlighted them in blue below: “A teacher is marking tests. Write an algorithm that allows the teacher to input the number of tests to mark and then the mark of each test . Output the average mark , highest mark and lowest mark . The tests are marked out of 100.” There is an additional variable to track as the average mark can only be worked out if we also know the total marks . number_of_tests is integer test_mark is integer average_mark is real highest_mark is integer lowest_mark is integer total is integer number_of_tests = 0 test_mark = 0 average_mark = 0 highest_mark = -1 lowest_mark = 101 total = 0 Before you write the actual program, you must declare the variables you will need and assign values to them. Firstly, declare the data type of each variable . A whole number is an integer and a decimal number is a real . The average must be a real data type because it is the result of division (total ÷ number_of_tests) and could be a decimal number . When assigning values, most numerical variables will be 0 . Most string values would be " " . However this question is a bit more complicated - the highest mark must start as a really low value and the lowest mark must start as a really high value . This is ensure the first mark entered becomes the highest and lowest mark - this will make sense later. Part 1: Input Number of Tests output “Enter the number of tests to mark: ” input number_of_tests After declaring and assigning your variables the next parts will depend on the algorithm you need to write. This example requires the user to input the number of tests . Part 2: Input Each Mark (Loop) for i = 1 to number_of_tests output “Enter the test mark: ” input test_ mark For part 2 we need the teacher to enter each test’s mark . This is best done as a loop as we do not know how many tests the teacher has to mark until they have typed it in (part 1). All code within the loop must be indented . if test_mark > highest_mark then highest_mark = test_mark endif if test_mark < lowest_mark then lowest_mark = test_mark endif We also need to work out what the highest and lowest marks are. This must be done within the loop as the test marks are entered. The test mark is compared to the current highest and lowest marks . If it is higher than the current highest mark it becomes the new highest mark . If it is lower than the current lowest mark it becomes the new lowest mark . This is why we set the highest_mark and lowest_mark to extreme values at the start - so the first mark entered becomes the new highest and lowest . total = total + test_mark next i The final steps of part 2 are to update the total marks and to close the loop . The total is increased by the test mark that has been entered. The ‘next i ’ command states that the current iteration has ended . The indentation has now stopped. Part 3: Outputs average_mark = total / number_of_tests output “The average mark is:” , average_mark output “The highest mark is:” , highest_mark output “The lowest mark is:” , lowest_mark Before the average can be output, it must be calculated by dividing the total by the number of tests . Then the average , highest and lowest marks can be output . Full Answer number_of_tests is integer test_mark is integer average_mark is real highest_mark is integer lowest_mark is integer total is integer number_of_tests = 0 test_mark = 0 average_mark = 0 highest_mark = -1 lowest_mark = 101 total = 0 output “Enter the number of tests to mark: ” input number_of_tests for i = 1 to number_of_tests output “Enter the test mark: ” input test_ mark if test_mark > highest_mark then highest_mark = test_mark endif if test_mark < lowest_mark then lowest_mark = test_mark endif total = total + test_mark next i average_mark = total / number_of_tests output “The average mark is:” , average_mark output “The highest mark is:” , highest_mark output “The lowest mark is:” , lowest_mark This example is slightly more complicated than some of the recent previous exam questions for writing algorithms. Remember to decompose the problem by identifying the variables you need first. Q uesto's Q uestions 8.3 - Writing Algorithms: 1. A violin player performs a piece of music 8 times . They record a score out of 5 how well they think they performed after each attempt. Write an algorithm using pseudocode that allows the violinist to enter the 8 scores and displays the highest score , lowest score and average score . An example score is 3.7. [10 ] 2. A cyclist wants a program to be made that allows them to enter how many laps of a circuit they have made and the time in seconds for each lap . For example they may enter 3 laps, with times of 20.3 , 23.4 and 19.8 seconds . The program should output the quickest lap time , slowest lap time , total amount of time spent cycling and the average lap time . Create an algorithm using pseudocode for this scenario. [10 ] 8.2 - Understanding Algorithms Theory Topics 8.4 - Sorting & Searching
- 3.4 - Web Technologies | OCR A-Level | CSNewbs
Learn about HTML, CSS, JavaScript, search engine indexing, the PageRank algorithm and client-side and server-side processing. Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level 3.4 - Web Technologies Specification: Computer Science H446 Watch on YouTube : HTML CSS JavaScript Search Engines & PageRank Server-Side & Client-Side Processing This topic looks at the languages that web pages are comprised of (HTML , CSS and JavaScript ) as well as search engines and network processing (client-side and server-side ). HTML HTML ( HyperText Markup Language ) is the standard language used to create and structure web pages . It uses tags enclosed in angle brackets to define elements on a page . A web page begins with , which contains a section for metadata , links and the
- Python | 1c - Creating Variables | CSNewbs
Learn how to create variables in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 1c - Creating Variables What is a Variable? A variable represents a value that can change as a program is running . The two parts of a variable are the name (e.g. sweets) and the value (e.g. 8). sweets = 8 print (sweets) = 8 amount of sweets = 8 8sweets = 8 sweets A variable can't contain spaces , it must start with a letter , and you must declare its value before you can use or print it. You always need to print the variable name (e.g. biscuits), not the value (20) as the value can change. Important – When writing variable names, we do not need speech marks. (e.g. type biscuits , not “biscuits”) We use variables because the value of something might change as the program is executed. For example, if someone eats a sweet then the value of our variable changes: sweets = 8 print (sweets) sweets = 7 print (sweets) = 8 7 sweets = 8 print ( Sweets) You must be consistent with capital letters when writing variable names. sweets and Sweets are treated as two different variables. Creating Variables Task 1 ( Age & Pets) Make a variable named age and set it to your current age. On the next line print age . Make another variable named pets and set it to how many pets you have. On the next line print pets . Example solution: 14 2 Variables with Strings (Text) In programming, a collection of alphanumeric characters (letters, numbers and punctuation) is called a string . "Pikachu" is a string. In the example below, pokemon is the variable name that represents the variable value "Pikachu" . pokemon = "Pikachu" print (pokemon) = Pikachu To create a string, we use "speech marks" . Numbers by themselves and variable names do not use speech marks. Each variable can only have one value at a time, but it can change throughout the program. pokemon = "Pikachu" print (pokemon) pokemon = "Squirtle" print (pokemon) = Pikachu Squirtle Creating Variables Task 2 ( Superhero & Colour ) Make a variable named superhero and set it to any of your choice, such as "Spider-Man" . Print the superhero variable on the next line. Make another variable named colour and set it to the colour related to your chosen superhero. Print the colour variable on the next line. Example solutions: Spider-Man Red The Hulk Green ⬅ 1b - Co mmenting 1d - Using Variables ➡
- Python | 10a - Open & Write to Files | CSNewbs
Learn how to create, open and write to files in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. Python 10a - Open & Write To Files Creating and Opening Files The "a" opens the file in append mode which will add new data to the end of the file. The open command is used to open files but it is also used to create new files . 'file' is just a variable and can be more relevant such as customer_file or whatever your file will be storing. Python looks in the same folder as your .py file and checks to see if Customers.txt already exists. If it doesn't exist, it will create the file . The .txt extension will create a Notepad file. You can use alternatives such as .text or .docs. Writing to a File In the example below I ask the user to input a name which is written to the Names.txt file. The .write command writes the contents of the brackets to the file . You must close the file with the .close() command or the contents will not be saved . The .write command can be adapted depending on how you want the file to appear: Your text file won't update while it is open . Close it and open it again to see any changes . If you make any mistakes, just edit the file by hand and save it again. Practice Task 1 Create a new file called MyFriends.txt Ask the user to enter 5 names. Write the 5 names into a file. Place each name on a separate line. Check the file to see if the names have been entered. Example solution: Writing Multiple Lines to a File Files are often used to store data about multiple people . The program below asks for a customer's name, appointment date and VIP status then saves this information into a file. The plus symbol is used to write information for a single customer on the same line . This is beneficial if you want to search for a customer later. Practice Task 2 Create a new file called ALevels.txt Ask the user to enter a student's name and their three A-Level subjects. Write each student's information on the same line. Enter at least three different students and check your file to see it has worked. Example solution: ⬅ Section 9 Practice Tasks 10b - Read & Search Files ➡
- Python | Section 3 Practice Tasks | CSNewbs
Test your understanding of data types, calculations and modulo. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python - Section 3 Practice Tasks Task One: Square Number Create a program that asks the user to input a number and then prints the square of that number - to do this, multiply the number by itself . Remember: Break up variables and parts of a sentence in a print line by using commas. Example solutions: Enter a number: 12 The square of 12 is 144 Enter a number: 7 The square of 7 is 49 Task Two: Multiplying Numbers X Example solutions: Create a program that asks the user to input two numbers (num1 and num2 ). Multiply the two numbers together and print the total . Remember: Break up integer variables in a print line by using commas between each part of the sentence. Enter number one: 7 Enter number two: 9 7 x 9 = 63 Enter number one: 8 Enter number two: 12 8 x 12 = 96 Task Three: Turning 65 Example solutions: Create a program to input how old the user will turn this year and then print the year they will turn 65 . You could do this in just two lines but before trying that work out on paper the steps to calculating your own age you will turn 65. What steps did you take? Try to recreate those steps in Python. You might need to create another variable to make it easier. How old will you turn this year? 15 You will turn 65 in 2073 How old will you turn this year? 42 You will turn 65 in 2046 Task Four: Multiplication Table Let the user enter a number then print the first five multiplications in its times table. This can be done more simply when you learn about for loops but for now you will need to multiply the number by 1 , then multiply it by 2 etc. Try to make this program better by displaying the number and the value it is multiplied by in your print statements. Simple example solution: Enter a number: 8 8 16 24 32 40 Better example solution: Enter a number: 7 7 x 1 = 7 7 x 2 = 14 7 x 3 = 21 7 x 4 = 28 7 x 5 = 35 ⬅ 3b - Simple Calculations 4a - If Statements ➡
- 1.1 - The CPU - Eduqas GCSE (2020 spec) | CSNewbs
Learn about the Central Processing Unit (CPU), the four components within and Von Neumann architecture. Based on the 2020 Eduqas GCSE (WJEC) specification. Exam Board: Eduqas / WJEC 1.1 The Central Processing Unit (CPU) Specification: 2020 + The Central Processing Unit ( CPU ) is the most important component in any computer system. The purpose of the CPU is to process data and instructions by constantly repeating the fetch - decode - execute cycle . CPU Components The control unit directs the flow of data and information into the CPU. It also controls the other parts of the CPU . ALU stands for ‘ Arithmetic and Logic Unit ’. It performs simple calculations and logical operations . The registers are temporary storage spaces for data and instructions inside the CPU. The registers are used during the FDE cycle . Five essential registers are explained in 1.2 . Cache memory is used to temporarily store data that is frequently accessed . Cache memory is split into different levels . Level 1 and level 2 (L1 & L2) are usually within the CPU and level 3 (L3) is just outside it. See 1.3 and 1.5 for more information about cache. You should know: The control unit is also known as the controller and cache memory is sometimes called internal memory . Computer Architecture The way a computer is designed and laid out is known as its architecture . The most common type of computer architecture is Von Neumann . Von Neumann Architecture The CPU is the most important component in Von Neumann architecture as it is constantly fetching and decoding instructions from RAM and controlling the other parts of the system . Von Neumann architecture also stores both instructions and data in memory . Being able to store programs in memory allows computers to be re-programmed for other tasks - this enables it to multitask and run several applications at the same time. Data input and output is another key feature of this architecture. An alternative architecture is Harvard , which features the control unit as the most essential component. Q uesto's Q uestions 1.1 - The Central Processing Unit (CPU): 1a. What does 'CPU ' stand for ? [1 ] 1b. What is the purpose of the CPU ? [ 2 ] 2a. Draw a diagram of the CPU , use the same symbols as shown on this page. [ 4 ] 2b. Label the four main components of the CPU. [ 4 ] 3. Describe the purpose of: a. The Control Unit [ 2 ] b. The ALU [ 2 ] c. The registers [ 2 ] d. Cache memory [ 2 ] 4a. Describe the key features of Von Neumann architecture . [ 3 ] 4b. Explain why storing data in memory is important. [ 1 ] 4c . State an alternative architecture . [ 1 ] Theory Topics 1.2 - The FDE Cycle
- Python | 5e - More Libraries | CSNewbs
Learn how to use the math library and to refresh the screen (on some editors only). Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 5e - More Libraries Clear Screen Importing the os library and using the .system() command with the "clear" parameter will clear the screen . The console won't clear on offline editors like IDLE but will work with many online editors like Replit. import os print ( "Hello" ) os. system ( "clear" ) print ( "Bye" ) Bye Clear Screen Task ( Trivia Questions ) Ask three trivia questions of your choice to the user and clear the screen between each one. You should display the total they got correct after the third question - to do this you need to set a variable called correct to equal 0 at the start and then add 1 to correct each time a correct answer is given . Example solution: The Math Library The math libraries contains several commands used for numbers: sqrt to find the square root of a number. ceil to round a decimal up to the nearest whole number and floor to round down to the nearest whole number. pi to generate the value of pi (π ). The sqrt command will find the square root of a number or variable placed in the brackets and return it as a decimal number . from math import sqrt answer = sqrt(64) print (answer) 8.0 The ceil command rounds a decimal up to the nearest integer and the floor command rounds a decimal down to the nearest integer . from math import ceil, floor answer = 65 / 8 print ( "True answer:" , answer) print ( "Rounded up:" , ceil(answer)) print ( "Rounded down:" , floor(answer)) True answer: 8.125 Rounded up: 9 Rounded down: 8 The pi command generates a pi value accurate to 15 decimal places . Pi is used for many mathematical calculations involving circles . The area of a circle is pi x radius² . The first example below uses 5.6 as the radius . from math import pi radius = 5.6 area = pi * (radius * radius) print ( "The area of the circle is" , area) The area of the circle is 98.5203456165759 The example below uses an input to allow the user to enter a decimal (float ) number for the radius. It also uses the ceil command to round the area up . from math import pi, ceil radius = float(input( " Enter the radius: " )) area = pi * (radius * radius) print ( "The area of the circle is" , ceil(area)) Enter the radius: 2.3 The area is 17 Clear Screen Task ( Area of a Sph ere ) The formula of a sphere is 4 x π x r² where π represents pi and r is the radius . Use an input line to enter the radius and then calculate the area of the sphere . Round the answer down to the nearest integer using floor and print it. Example solution: Enter the radius: 7.1 The area of the sphere is 633 ⬅ 5d - Coloram a Section 5 Practice Tasks ➡
- OCR CTech IT | Unit 1 | 1.5 - Communication Hardware | CSNewbs
Learn about different types of hardware that allow data to be sent between systems, including router, modem, bridge and WAP. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 1.5: Communication Hardware Exam Board: OCR Specification: 2016 - Unit 1 The devices on this page are used to create or link together networks , allowing data to be sent between computer systems . Hub A hub receives data packets from a connected device and transfers a copy to all connected nodes . Switch A switch receives data packets , processes them and transfers them on to the device s pecifically listed in the destination address of the packet. Modem Modems are used to send data across the telephone network . The telephone lines can only transfer analog signals so a modem is used to convert a computer's digital data into an analog signal . Another modem converts the signal back to a digital format at the receiving end. Router Routers are used to transfer data packets between networks . Data is sent from network to network on the internet towards the destination address listed in the data packet. A router stores the address of each computer on the network and uses routing tables to calculate the quickest and shortest path . Wireless Access Point (WAP) Provides a link between wireless and wired networks . It creates a wireless local area network that allows WiFi enabled devices to connect to a wired network. Combined Device Also known as a hybrid device , this provides the functionality of multiple communication devices (e.g modem, router, switch and/or wireless access point) in a single device . They can be more expensive than a single device but are more adaptable - if the routing part of the device fails it might still be able to function as a switch / wireless access point etc. However, you will see an increased performance from a standalone device rather than a combined one as standalone devices have more complex features (e.g. VPN support). Network Interface Card (Network Adapter) A Network Interface Card (often shorted to NIC ) is an internal piece of hardware that is required for the computer to connect to a network . It used to be a separate expansion card but now it is commonly built directly into the motherboard (and known as a network adapter ). Wireless network interface cards allow wireless network connection. Q uesto's Q uestions 1.5 - Communication Hardware: 1. What is the difference between a hub and a switch ? [2 ] 2. Explain how a modem works. [3 ] 3. Explain the purpose of a router . [2 ] 4. What is a Wireless Access Point (WAP )? [2 ] 5. Describe what is meant by a 'combined device '. Give one advantage and one disadvantage of using a combined device. [3 ] 1.4 - Connectivity 1.6 - Hardware Troubleshooting Topic List
- Key Stage 3 Python | Variables | CSNewbs
The first part of a quick guide to the basics of Python aimed at Key Stage 3 students. Learn about comments and printing. Python - #2 - Variables 1. Number Variables A variable is a value that can change . Imagine there are 20 biscuits in a jar. Then I eat one. Now there are only 19. You must state what the value of a variable is before it is used . e.g. biscuits = 20 Task 1 - Create a new Python program and save the file as 2-Variables.py Create a variable called sweets and give it the value 15. Then print sweets. Variable names cannot have spaces . You can use underscores if you want, e.g. num_of_eggs When you are printing variables, you don't put them in speech marks . Otherwise, it will print the variable name and not the value. 2. String Variables A string is a programming term for a collection of characters . When you are giving a variable a string value, it must be written in speech marks . Remember when you print the variable however, it is never printed in speech marks . Task 2 - Create a variable called name and give it the value of your name. Then print the name variable. 3. Using Variables in a Sentence When we have printed the variables so far, they have not been very informative! You can print variables together with sentences so that they mean more. Use a comma ( , ) between variables and sentences . Task 3 - Use the pictures to help you add commas and sentences to your program to be more informative. 4. Using Variables Together You can print more than one variable together in the same sentence by separating them with sentences and commas . If this doesn't work, double-check your program has a comma between each variable and sentence . Task 4 - Type a new print line that uses both your name and your sweets variables together. Use the image to help you. Challenge Programs Use everything that you have learned on this page to help you create these programs... Challenge Task 1 - Funny Animals Create a new Python program. Save it as ' 2-FunnyAnimals.py ' Add a comment at the top with your name and the date. Create a variable for a colour and give it a value (e.g. "blue") Create a variable for an animal and give it a value (e.g. "horse") Print a funny sentence that uses both variables. BONUS : Try to use only one print line. BONUS : Try to use only three lines in total . Remember: Break up variables in a print line by using commas. When you run it, it could look something like this: Challenge Task 2 - Funny Sentence Create a new Python program. Save is as ' 2-FunnySentence.py ' Add a comment at the top with your name and the date. Write a program that uses three variables, an adjective (descriptive word), a number and an animal. Print a funny response using all variables. BONUS : Try to use only one print line. BONUS : Try to use only four lines in total . Remember: Break up variables in a print line by using commas. When you run it, it could look something like this: <<< #1 The Basics #3 Inputs >>>
- Malware | Key Stage 3 | CSNewbs
Learn about different forms of malware including virus, worm and trojan. Learn about the different ways that malware can infect a computer system. Malware Malware is any type of harmful program that seeks to damage or gain unauthorised access to your computer system. Part 1: SiX Types of Malware Virus A virus can replicate itself and spread from system to system by attaching itself to infected files . A virus is only activated when opened by a human . Once activated, a virus can change data or corrupt a system so that it stops working . Trojan A trojan is a harmful program that looks like legitimate software so users are tricked into installing it . A trojan secretly gives the attacker backdoor access to the system . Trojans do not self replicate or infect other files. Ransomware Ransomware locks files on a computer system using encryption so that a user can no longer access them. The attacker demands money from the victim to decrypt (unlock) the data . ? ? Attackers usually use digital currencies like bitcoin which makes it hard to trace them. Spyware Spyware secretly records the activities of a user on a computer. The main aim of spyware is to record usernames, passwords and credit card information . All recorded information is secretly passed back to the attacker to use. Keylogger A keylogger secretly records the key presses of a user on a computer. Data is stored or sent back to the attacker. The main aim of a keylogger is to record usernames, passwords and credit card information . Keyloggers can be downloaded or plugged into the USB port . Worm A worm can replicate itself and spread from system to system by finding weaknesses in software . A worm does not need an infected file or human interaction to spread. A worm can spread very quickly across a network once it has infiltrated it. Part 2: Four ways malware cAN infect your system 1. A ccidentally downloading an infected file from an insecure website . 2. Phishing emails - clicking on attachments or links in spam emails . 3. Installing malware from a physical device, e.g. USB stick . 4. Self-replicating malware , such as worms , spreading across a network . Phishing & Staying Safe
- 3.2 - Testing - OCR GCSE (J277 Spec) | CSNewbs
Learn about why testing is needed, types of testing, types of test data and types of error. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 3.2: Testing Exam Board: OCR Specification: J277 Watch on YouTube : Purpose of Testing Types of Error Test Data The main purpose of testing is to ensure that a program works correctly no matter what input has been entered by the user. Other reasons to test a program include ensuring the user requirements have been met , errors have been removed and the program doesn't crash while running . Types of Testing Iterative Testing Iterative testing takes place during program development . The programmer develops a module , tests it and repeats this process until the module works as expected . Final Testing Final testing, also known as terminal testing , takes place after development and before the program is released to the end user. This testing takes place once all modules have been individually tested to ensure the whole program works as originally expected. Programming Errors Syntax Error Logical Error A syntax error is a mistake in the grammatical rules of the programming language , such as an incorrect spelling of a command word. A syntax error will prevent the program from being compiled and executed . Examples: Incorrect Spelling: pront ( "hello" ) Incorrect punctuation: print ( "hello" ( A logic error is a mistake made by the programmer - the program runs without crashing but will display the wrong output . Examples: Incorrect calculation: total = num1 - num2 print (total) Incorrect variable printed: age = 16 name = "Steve" print ( "Nice to meet you" , age) Test Data Test data is used to test whether a program is functioning correctly . It should cover a range of possible and incorrect inputs , each designed to prove a program works or to highlight any flaws . Four types of test data are: Normal data - Sensible data that the program should accept and be able to process . Boundary data - Data at the extreme boundary of any data ranges. Invalid data - Data of the correct data type that does not meet the validation rules (e.g. outside of the range). It should not be accepted . Erroneous data - Data of the wrong data type that the program cannot process and should not accept . Q uesto's Q uestions 3.2 - Testing: 1. Give 3 reasons why programs are tested . [ 3 ] 2. What is the difference between iterative and final testing ? [ 2 ] 3a. What is a syntax error ? Give an example . [ 2 ] 3b. What is a logical error ? Give an example . [ 2 ] 4. State and describe the four types of test data . [ 6 ] 3.1 - Defensive Design Theory Topics 4.1 - Boolean Logic









