Search CSNewbs
304 results found with an empty search
- 3.1 - Planning Projects | F160 | Cambridge Advanced National in Computing AAQ
Learn about the importance of planning application development projects, including the advantages and disadvantages of planning and the consequences of not planning. Also covers planning considerations such as budget, time, resources, success criteria and legislation. Based on Unit F160 (Fundamentals of Application Development) for the OCR Cambridge Advanced National in Computing (H029 / H129) (AAQ - Alternative Academic Qualification). Qualification: Cambridge Advanced National in Computing (AAQ) Unit: F160: Fundamentals of Application Development Certificate: Computing: Application Development (H029 / H129) 3.1 - Planning Projects Watch on YouTube : Purpose of Planning Planning Considerations Planning Projects You need to know why it is important to plan an application development project , as well as the advantages and disadvantages of taking the time to plan . You must also consider the potential consequences if a development team decide not to plan their project. There are several considerations (e.g. budget , time and legislation ) that must be looked at in the planning stage and you need to know how these may impact application development . You need to be aware of copyright , data protection and electronic communication legislation , but for this unit , you do not need to know the details of any specific laws . Importance of Planning Projects Planning application development projects is important as it sets clear goals and direction for the project and identifies required resources (e.g. time , money , people and tools ). Other advantages include better organisation , as team members should know their roles and tasks . Also, planning improves time management as deadlines and milestones keep the project on track . However, there are disadvantages to planning as it takes time and can delay the start of development . Also, plans may become outdated if requirements unexpectedly change mid-project . Avoiding planning entirely will have consequences , such as a higher potential for missed deadlines and overrunning costs due to poor time / budget estimates . Goals may be unclear , leading to confusion , delays or an unusable product . Planning Considerations There are several considerations team members must carefully evaluate in the planning phase of application software development : The three types of legislation cover copyright , data protection and electronic communication . Q uesto's Q uestions 3.1 - Planning Projects: 1. A company developing smartphones is considering whether to skip the planning stage and move straight to design. Give two advantages and two disadvantages of planning and two consequences of not planning an application development project . [6 ] 2. Summarise the impact of the three identified types of legislation on application development . [6 ] 3. Justify which planning consideration you think has the biggest potential impact on the success of a software application development project and why . [ 3 ] 4. Describe the impact of three planning considerations (other than legislation and the one you chose in Q3 ) on application development . [6 ] If a company seriously breaches the Data Protection Act , it can be fined up to £17.5 million or 4% of its global turnover , whichever is higher . D id Y ou K now? 2.2 - Phases of Development Models Topic List 3.2 - Project Planning Tools
- 5.1 - Testing | F161 | Cambridge Advanced National in Computing | AAQ
Learn about the importance of testing applications, test plan structure, test types and test data. Resources based on Unit F161 (Developing Application Software) for the OCR Cambridge Advanced Nationals in Computing (H029 / H129) AAQ (Alternative Academic Qualification). Qualification: Cambridge Advanced Nationals in Computing (AAQ) Certificate: Computing: Application Development (H029 / H129) Unit: F161: Developing Application Software 5.1 - Testing Watch on YouTube : Purpose of testing Test plan structure Test data Types of testing You need to know the purpose , importance , advantages and disadvantages of testing applications , as well as the impacts of not carrying out testing . You must understand the structure and contents of test plans and the importance of testing , remedial actions and retesting during application development. You need to know the role of each type of test data (normal , extreme and erroneous ). Finally, the purpose , advantages and disadvantages of each type of testing (technical and user ) must be known as well as when and how each type should take place . What You Need to Know Purpose of Testing ? YouTube video uploading soon Test Plan Structure ? YouTube video uploading soon Types of Test Data ? YouTube video uploading soon Types of Testing ? YouTube video uploading soon Q uesto's Q uestions 5.1 - Testing: 1. What? [2 ] 2. What? [1 ] 3. What? [1 ] 4. What? [1 ] ? D id Y ou K now? 4.1 - Security Considerations Topic List 5.2 - Application Installation
- 2.4 - Programming Languages | OCR A-Level | CSNewbs
Learn about programming paradigms such as procedural language (e.g. Python), assembly language (including Little Man Computer) and object-oriented programming (OOP) language (e.g. Java). Methods of memory addressing (immediate, direct, indirect and indexed) are also covered. Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level 2.4 - Types of Programming Language Specification: Computer Science H446 Watch on YouTube : Programming Paradigms Procedural Language Little Man Computer Addressing Modes Object-Oriented Language Programming paradigms are different approaches to writing and structuring code to solve problems . The procedural paradigm focuses on step-by-step instructions and the use of functions to organise tasks . The assembly paradigm operates at a low level , giving direct control over hardware through processor-specific instructions . The object-oriented paradigm models programs around objects that combine data ( attributes ) and behaviour ( methods ), promoting modular and reusable design . Procedural Language A procedural programming language organises code into reusable blocks ( procedures or functions ), which perform specific tasks in a step-by-step manner . It focuses on a clear sequence of instructions that operate on data, often using variables , loops and conditionals . Examples include Python , C , Pascal and BASIC . These languages are commonly used for software development , data processing and teaching programming fundamentals as they emphasise logical structure and modular design . Assembly Language / Little Man Computer Assembly language is a low-level programming language that uses short , readable codes called mnemonics to represent machine-level instructions executed by the CPU . Each command in assembly corresponds closely to a specific hardware operation , making it highly efficient but difficult to write and maintain . It is mainly used for embedded systems , device drivers and performance-critical tasks where direct control of hardware is required . For the OCR A-Level course , you must understand and be able to write code using the 11 mnemonics of Little Man Computer ( LMC ), which is an educational form of assembly language . Modes of Addressing Memory An addressing mode in assembly language defines how the CPU should locate the data (operand ) needed for an instruction (opcode ). It tells the processor whether the data is stored directly in the instruction , in memory , or needs to be calculated using an address or register . There are four main types : Immediate addressing : The operand contains the actual data to be used , rather than a memory address. Direct addressing : The operand contains the memory address where the required data is stored . Indirect addressing : The operand contains an address that points to another memory location holding the actual data . Indexed addressing : The operand provides a base address that is adjusted by the value in an index register to find the final memory address of the data . Object-Oriented Language An object-oriented programming ( OOP ) language organises code around objects , which combine data ( attributes ) and behaviour ( methods ) into reusable units . Key features of OOP : Classes are templates from which objects are created . Classes define both attributes (data ) and methods (functions or behaviours ). Encapsulation allows data to be protected by making attributes private and providing controlled access through public methods . Inheritance enables a class to reuse or extend the attributes and methods of a parent class , promoting the reuse of code . Polymorphism allows methods or attributes to behave differently depending on the object or class that uses them . Examples of OOP languages include Java , Python , C++ and C# . These languages are widely used for large-scale software development , game development and graphical user interfaces , where modularity and code reuse are crucial . YouTube video uploading soon This page is under active development. Check here for the latest progress update. YouTube video uploading soon Q uesto's K ey T erms Programming Paradigms: procedural language, assembly language, object-oriented language Procedural Language: input, output, comments, variables, casting, count-controlled iteration, condition-controlled iteration, logical operators, selection, string handling, subroutines, arrays, files Assembly Language: Little Man Computer, INP, OUT, LDA, STA, ADD, SUB, HLT, DAT, BRA, BRP, BRZ Modes of Addressing Memory: immediate, direct, indirect, indexed, index register, opcode, operand Object-Oriented Language: class, method, attribute, encapsulation, inheritance, polymorphism, instantiation, constructor method, get method, set method D id Y ou K now? Python was named after the 1970s British comedy group ' Monty Python ', not the snake . Guido van Rossum created Python in the late 1980s during his Christmas holidays as a ' hobby project '. 2.3 - Software Development A-Level Topics 3.1 - Compression & Encryption
- Unit F160 - Fundamentals of Application Development - Cambridge Advanced National in Computing | CSNewbs
Navigate between all Unit F160 (Fundamentals of Application Development) topics in the OCR Cambridge Advanced National in Computing (AAQ) specification. Qualification: Cambridge Advanced National in Computing (AAQ) Unit: F161: Developing Application Software Certificate: Computing: Application Development (H029 / H129) Unit F161: Developing Application Software These pages are based on content from the OCR Cambridge Advanced National in Computing (AAQ) specification . Unit F161 YouTube Playlist Topic 1: Application Software Considerations 1.1 - Application Platforms 1.2 - Devices 1.3 - Storage Locations This unit will be updated in summer 2026. Check here for the latest progress update. Topic 2: Data & Flow in Application Software 2.1 - Data Formats & Types 2.2 - Data Flow 2.3 - Data States Topic 3: API & Protocols 3.1 - Application Programming Interfaces (API) 3.2 - Protocols Topic 4: Application Software Security 4.1 - Security Considerations Topic 5: Operational Considerations 5.1 - Testing 5.2 - Types of Application Software Installation 5.3 - Policies Topic 6: Legal Considerations 6.1 - Legal Considerations
- OCR CTech IT | Unit 1 | 1.7 - Units of Measurement | CSNewbs
Learn about the two types of data storage unit systems and how the increments work, including kilobyte and kibibyte. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 1.7 - Units of Measurement Exam Board: OCR Specification: 2016 - Unit 1 All computer systems communicate , process and store data using binary because this is the format that the processor understands . Binary is a number system consisting entirely of 0s and 1s . A single binary data value (a 0 or a 1 ) is called a bit . 4 bits is called a nibble (e.g. 0101 or 1100). 8 bits is called a byte (e.g. 10101001 or 01011100). There are two main measurement systems : Metric Units of Measurement The gap between units when using metric values (also known as the decimal system ) is always 1,000 . For example, there are 1,000 bytes in 1 kilobyte and 1,000 kilobytes in 1 megabyte . To convert between metric units , divide by 1,000 when moving to a larger unit (e.g. 500 megabytes is 0.5 gigabytes ) and multiply by 1,000 when moving to a smaller unit (e.g. 4.7 terabytes is 4,700 gigabytes ). For example, 8,520 KB is the same as 8.52 MB or 0.00825 GB . Metric values (usually) have a prefix ending in ‘ a ’ such as mega byte or giga byte. Binary Units of Measurement The gap between units when using binary values is always 1,024 . For example, there are 1,024 bytes in 1 kibibyte and 1,024 kibibytes in 1 mebibyte . To convert between binary units , divide by 1,024 when moving to a larger unit (e.g. 4,096 kibibytes is 4 mebibytes ) and multiply by 1,024 when moving to a smaller unit (e.g. 55 pebibytes is 55,296 tebibytes ). For example, 34 KiB is the same as 34,816 MiB or 35,651,584 GiB . Bi nary values have a prefix ending in ‘ bi ’ , such as ki bi byte or me bi byte. Computer scientists often use the binary system of measurement because the storage size is technically more accurate . Q uesto's Q uestions 1.7 - Units of Measurement: 1 a. Create a table or list that clearly shows the relationship between values from bit up to petabyte for the metric (decimal) measurement system . [4 ] 1 b. Create another table to display the binary measurement system from bit to pebibyte . [4 ] 2. Make the following conversions and show your working out . [2 each ] a. 40 megabytes into kilobytes . b. 8500 gigabytes into terabytes . c. 100 mebibytes into kibibytes . d. 854,016 mebibytes into gibibytes . e. How many bytes are there in 3 megabytes ? f. How many bytes are there in 3 mebibytes ? 1.6 - Hardware Troubleshooting 1.8 & 1.9 - Number Systems Topic List
- HTML List of Tags | CSNewbs
A complete list of tags required for students to know how to use in the 2016 Eduqas GCSE specification. Follow the links on each tag to see how to use them. Here you can find a list of tags. Click a tag to see how to use it. Tags for Eduqas GCSE:
- OCR CTech IT | Unit 1 | 4.6 & 4.7 - Bodies & Certification | CSNewbs
Learn about the purpose of professional bodies and IT industry certification. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 4.6 & 4.7 - Bodies & Certification Exam Board: OCR Specification: 2016 - Unit 1 What is a professional body? A professional body is an organisation that seeks to develop and support workers in a certain profession. Professional bodies will share best practice , help people starting in the profession and support any role-related learning . In the UK a popular professional body is the British Computer Society (BCS) - also known as the Chartered Institute for IT - with over 65,000 members. What is industry certification? Professional bodies exist to provide trainees with industry certification . Industry certifications are qualifications in different areas of expertise so applicants are trained with up-to-date knowledge and skills . Two popular organisations that administer industry certifications in America are Cisco and CompTia . Cisco's website claims that they provide "certifications for all experience levels covering topics in networking , security , collaboration , and more. Cisco's certification program can meet you where you are on your learning journey and take you to where you want to go." Advantages of Industry Certification Disadvantages of Industry Certification Develop IT skills: Trainees develop experience and competency in areas relevant to actual jobs. Access resources: Trainees are part of a network of like-minded professionals with access to help from experts . P rofessional development opportunities: Trainees are invited to special events and seminars to ensure skills remain up-to-date . Cost: Training for industry certification can cost hundreds or even thousands of pounds and is often self-funded . No guarantees: Earning a certificate doesn't guarantee you a better job or more money. Time and dedication: Like other qualifications, classroom activities or online learning must be completed. Exams must be passed at the end of the course. Many organisations now require IT employees to have earned relevant industry certifications . This is so that the organisation can be confident that the employee has been appropriately trained and will have gained experience at the required level for the certification. The employee should be able to demonstrate technical knowledge as a result of gaining the certification. Q uesto's Q uestions 4.6 & 4.7 - Bodies & Certification: 1a. What is a professional body ? [1 ] 1b. State 3 roles of a professional body . [3 ] 2. What are industry certifications ? [2 ] 3. Describe 3 advantages and 3 disadvantages of an IT worker earning industry certifications . [2 each ] 4. Why do many IT organisations require its employees to have earned industry certifications ? [4 ] 4.5 - Job Roles Topic List 5.1 - Ethical Issues
- 10.3 - Programming Errors - Eduqas (2020 Spec) | CSNewbs
Learn about the six programming errors - syntax, runtime (execution), linking, logical, rounding and truncation. Based on the 2020 Eduqas (WJEC) GCSE specification. 10.3: Programming Errors Exam Board: Eduqas Specification: 2020 Syntax Error A syntax error is a mistake in the grammar or spelling of the program. A syntax error will prevent the program from being compiled . Examples: Incorrect Spelling: pront ( "hello" ) Incorrect punctuation: print ( "hello" ( Execution (Runtime) Error An execution error is when the program unexpectedly stops as a result of an operation during execution . Examples: Dividing by zero: 400 / 0 Reading too far in a file: #There are 50 lines in the file line = file.readlines( ) print ( line [100] ) Logical Error Linking Error A logical error is a mistake made by the programmer - the program still works but displays the wrong output . Examples: Truncation Error Rounding Error A linking error occurs when a compiler can’t find a sub procedure (e.g. the random library in Python) that has been used. The programmer might have declared it incorrectly or forgotten to link (import) it . Examples: Spelling an import command incorrectly: import ramdon number = random.randint(1,10) Requesting a function without linking: number = random.randint(1,10) Incorrect calculation: total = num1 - num2 print (total) Incorrect variable printed: age = 16 name = "Steve" print ( "Nice to meet you" , age) A rounding error is when the program rounds a real number to a fixed number of decimal places. This results in losing some value as the number becomes less accurate . Examples: Rounding up: 80.87 = 80.9 (Inaccurate by 0.03) Rounding down: 63.4 = 63 (Inaccurate by 0.4) A truncation error is when the program truncates a real number to a fixed number of decimal places . This results in losing some value as the number becomes less accurate . Examples: Truncation to 2 decimal places: 92.13787 = 92.13 (Inaccurate by 0.00787) Truncation to 1 decimal place: 25.199876 = 25.1 (Inaccurate by 0.099876) Q uesto's Q uestions 10.3 - Programming Errors: 1. Describe and give an example of each type of error: a. Syntax Error [ 3 ] b. Execution (Runtime) Error [ 3 ] c. Logical Error [ 3 ] d. Linking Error [ 3 ] e. Rounding Error [ 3 ] f. Truncation Error [ 3 ] 2. State the error that will occur for each scenario: [1 each ] a. A command word (such as for or print) has been misspelt. b. The average speed is 120.3856 but only 120.3 is displayed. c. The cost of a meal is £47 but £40 is displayed. d. A program uses a subroutine that has not been imported. e. The height of a dog is 33.38cm but 33.4cm is displayed. f. The user wants to read line 9 of a file that only has 6 lines. g. The user's age is printed instead of their name. h. The programmer has typed print("hello"( i. A number is divided by 0. j. The program is asked to generate a random number but 'import random' has not be written. 10.2 - Stages of Compilation Theory Topics 11.1 - Impacts of Technology
- Python | 8a - Using Lists | CSNewbs
Learn how to create and use lists in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 8a - Using Lists Lists A list is a temporary data structure . Any changes made to the list while the program is running will not be saved the next time it is run . Data can be added to and removed from lists so they can change in size (unlike an array which is fixed and not used in Python). It is important to note that each data element in a list has an index so that it can be specifically referenced (to delete it for example) and that indexes start at 0 . A list of the rainbow colours in order would start at 0 like this: Creating & Printing Lists Lists use square brackets in Python. Separate list items with commas . Strings must use speech marks and integers do not use speech marks. people = [ "Alan" , "Jesse" , "Max" , "Jack" ] years = [ 2010, 2019, 2001, 2016 ] There are many different ways to print items from a list depending on how you want it to look . Print all items on one line Type the list name into a print command to output the complete list . Typing an asterisk * before the list name removes punctuation . cities = [ "Shanghai" , "Sao Paolo" , "Bishkek" , "Asmara" ] print (cities) cities = [ "Shanghai" , "Sao Paolo" , "Bishkek" , "Asmara" ] print (*cities) ['Shanghai', 'Sao Paolo', 'Bishkek', 'Asmara'] Shanghai Sao Paolo Bishkek Asmara Print each item on a separate line To print a list line-by-line use a for loop to cycle through each item. 'city ' is just a variable name and can be replaced with the traditional 'i ' or anything relevant to the context, such as 'colour ' in a list of colours or 'name ' in a list of people. cities = [ "Shanghai" , "Sao Paolo" , "Bishkek" , "Asmara" ] for city in cities: print (city) Shanghai Sao Paolo Bishkek Asmara Print separated items on one line To print separated data elements on the same line then you can use the end command which defines what should go after each item . The example below uses slashes but end = " , " would add comma and space between each element. cities = [ "Shanghai" , "Sao Paolo" , "Bishkek" , "Asmara" ] for city in cities: print (city, end = " / " ) Shanghai / Sao Paolo / Bishkek / Asmara / Print specific list items To print an element with a certain index , put the index in square brackets . But remember that the index starts at 0 not 1. cities = [ "Shanghai" , "Sao Paolo" , "Bishkek" , "Asmara" ] print ( "The first city is" , cities[0]) print (cities[2], "is the third city" ) The first city is Shanghai Bishkek is the third city Create a list of five different foods . Print all list items on one line . Then print each item on a different line . Finally print just the first and fifth items . Example solution: lettuce yoghurt tomato artichoke tuna lettuce yoghurt tomato artichoke tuna The first item is lettuce The fifth item is tuna Lists Task 1 (Five Foods ) Lists Task 2 (Four Numbers ) Create a list of four integer values . Print all list items on one line separated by colons . Example solutions: 345:123:932:758: 812:153:783:603: Add (Append / Insert) to a List Append items to the end of a list To add a new item to the end of a list use the .append() command. Write .append() after the name of your list, with the new data in brackets . pets = [ "dog" , "cat" , "hamster" ] pets.append( "rabbit" ) print (*pets) fillings = [ "ham" , "cheese" , "onion" ] extra = input ( "Enter another filling: " ) fillings.append(extra) print ( "Your sandwich:" , *fillings) dog cat hamster rabbit Enter another filling: lettuce Your sandwich: ham cheese onion lettuce Insert items to a specific index Use the insert command to place an item in a specific position within the list. Remember that Python counts from 0 so the medals example below puts "silver" as index 2 , which is actually the 3rd item . medals = [ "platinum" , "gold" , "bronze" ] medals.insert(2, "silver" ) print (*medals) names = [ "Stacy" , "Charli" , "Jasper" , "Tom" ] name = input ( "Enter a name: " ) position = int ( input ( "Enter an index: " )) names.insert(position,name) print (*names) platinum gold silver bronze Enter a name: Lena Enter an index: 0 Lena Stacy Charli Jasper Tom Enter a name: Pat Enter an index: 3 Stacy Charli Jasper Pat Tom Use a loop to add items to a list A for loop can be used to add a certain number of items to a list. A while loop can be used to keep adding values until a certain value (e.g. ' stop ' or ' end ') is input. animals = [ ] for i in range (4): animal = input ( "Enter an animal: " ) animals.append(animal) print ( "\nAnimals:" , *animals) animals = [ ] while True : animal = input ( "Enter an animal: " ) if animal == "stop" : break else : animals.append(animal) print ( "\nAnimals:" , *animals) Enter an animal: lion Enter an animal: horse Enter an animal: hyena Enter an animal: squirrel Animals: lion horse hyena squirrel Enter an animal: rhino Enter an animal: gazelle Enter an animal: deer Enter an animal: stop Animals: rhino gazelle deer Example solution: Lists Task 3 (Favourite Musicicans ) Create a list of three musicians or bands you like . Print the list . Then append two new bands using two inputs . Print the list again. Use the sandwich filling example for help. Musicians I like: Lana Del Rey Devon Cole Elly Duhé Enter another musician: Charli XCX Enter another musician: Kenya Grace Musicians I like: Lana Del Rey Devon Cole Elly Duhé Charli XCX Kenya Grace Lists Task 4 (Missing 7 ) Create a list of numbers in order from 1 to 10 but miss out 7 . Use the insert command to add 7 in the correct place . Print the list before and after you insert 7. Example solution: 1 2 3 4 5 6 8 9 10 1 2 3 4 5 6 7 8 9 10 Lists Task 5 ('Land' Countries ) Use a while True loop to input countries that end in 'land' until the word 'finish ' is input . Print the list at the end. Note: You do not need to check if the countries entered are correct. There are also more than four. Example solution: Enter a country ending in 'land': Iceland Enter a country ending in 'land': Poland Enter a country ending in 'land': Switzerland Enter a country ending in 'land': Thailand Enter a country ending in 'land': finish Country list: Iceland Poland Switzerland Thailand Delete (Remove/Pop) from a List Delete items with a specific value To delete data with a certain value use the .remove() command, with the value in brackets . trees = [ "fir" , "elm" , "oak" , "yew" ] trees.remove( "elm" ) print (*trees) fir oak yew trees = [ "fir" , "elm" , "oak" , "yew" ] tree = input ( "Select a tree to remove: " ) trees.remove(tree) print (*trees) Select a tree to remove: oak fir elm yew Delete items with a specific index To delete data in a specific position in your list use the .pop() command, with the position in the brackets . Remember that indexes start at 0 so .pop(0) removes the first item . Negative values start from the end of the list , so -1 is the final item and -2 is the second last item and so on. kitchen = [ "plate" , "cup" , "spoon" , "jug" ] kitchen.pop(0) print (*kitchen) kitchen = [ "plate" , "cup" , "spoon" , "jug" ] kitchen.pop(-2) print (*kitchen) kitchen = [ "plate" , "cup" , "spoon" , "jug" ] index = int ( input ( "Select an index: " )) kitchen.pop(index) print (*kitchen) cup spoon jug plate cup jug Select an index: 1 plate spoon jug Delete all items in a list To delete data in a list use the .clear() command. insects = [ "ant" , "bee" , "wasp" ] insects.clear() insects.append( "hornet" ) print (*insects) hornet Lists Task 6 (Day Off ) Example solution: Create a list with the five week days . Ask the user to input a weekday and remove that day from the list. Print the list. Which day do you want off? Tuesday Your new days of work: Monday Wednesday Thursday Friday Lists Task 7 (May and October ) Create a list with the twelve months in order . Delete May and then October using the pop command by referring to their indexes in the list. Print the list. Note: Be aware the index of each month after May will change when May is popped from the list. Example solution: January February March April June July August September November December Finding the Length of a List To find the length of a list use the len function. You can create a separate variable for the length (shown in the first example below) or use the len command directly (second example). states = [ "Maine" , "Utah" , "Ohio" , "Iowa" ] length = len (states) print ( "There are" , length , "states in the list." ) states = [ "Maine" , "Utah" , "Ohio" , "Iowa" ] print ( "There are" , len (states), "states in the list." ) There are 4 states in the list. Lists Task 8 (Q Words ) Use a while True loop to input words beginning with q until the word ' stop ' is entered. Then use len to find the length of the list and print this value. Note: You do not need to check if the entered words actually start with q. Example solution: Input a Q word: question Input a Q word: quick Input a Q word: quiet Input a Q word: quandry Input a Q word: stop You wrote 4 Q words! Cycle Through List Items A for loop can be used to cycle through each item in a list. The following examples present some ways that this may be used. This program uses a for loop to add a word (David) before each list item. davids = [ "Beckham" , "Attenborough" , "Schwimmer" , "Tennant" , "Lynch" ] for i in range (5): print ( "David" , davids[i]) David Beckham David Attenborough David Schwimmer David Tennant David Lynch An if statement can be used within a for loop to check the value of each item . The example below checks how many items are 'medium'. sizes = [ "small" , "medium" , "small" , "large" , "medium" , "small" ] count = 0 for i in range (6): if sizes[i] == "medium" : count = count + 1 print ( "There were" ,count, "medium choices." ) There were 2 medium choices. The program below uses a while loop to allow entries until 'stop ' is input then a for loop to check the value of each item . Because the final length of the list is not known when the program starts, the len command is used in the range of the for loop . sports = [] fcount = 0 rcount = 0 while True : option = input ( "Choose football or rugby: " ) sports.append(option) if option == "stop" : break for i in range ( len (sports)): if sports[i] == "football" : fcount = fcount + 1 elif sports[i] == "rugby" : rcount = rcount + 1 print ( "\nResults:" ,fcount, "people chose football and" ,rcount, "chose rugby." ) Choose football or rugby: rugby Choose football or rugby: rugby Choose football or rugby: football Choose football or rugby: rugby Choose football or rugby: football Choose football or rugby: stop Results: 2 people chose football and 3 chose rugby. Lists Task 9 (Over 25 ) Create a list with the following eight numbers: 13, 90, 23, 43, 55, 21, 78, 33 Use a for loop to cycle through the list and check if each item is over 25 . Use a count variable to increase by 1 if the number is over 25. At the end print how many numbers are over 25 - there are five . Example solution: 5 numbers are over 25. Lists Task 10 (Favourite Lesson ) Use a while True loop to keep inputting school subjects until ' done ' is entered. Keep a count of how many times ' Maths ' is entered. Print the total number of people who entered maths. Example solution: Enter a subject: English Enter a subject: Maths Enter a subject: Art Enter a subject: Maths Enter a subject: History Enter a subject: done There were 2 people who chose maths. Sorting Lists The .sort() command will sort elements in a list into alphabetical order (if a string ) or numerical order (if a number ). names = [ "Robb" , "Jon" , "Sansa" , "Arya" , "Bran" , "Rickon" ] print ( "Original:" , *names) names.sort() print ( "Sorted:" , *names) Original: Robb Jon Sansa Arya Bran Rickon Sorted: Arya Bran Jon Rickon Robb Sansa numbers = [56,98,23,12,45] numbers.sort() print (*numbers) 12 23 45 56 98 The .sort() command can be used to sort values in descending order by including reverse = True in the brackets. names = [ "Robb" , "Jon" , "Sansa" , "Arya" , "Bran" , "Rickon" ] print ( "Original:" , *names) names.sort(reverse = True ) print ( "Sorted:" , *names) Original: Robb Jon Sansa Arya Bran Rickon Sorted: Sansa Robb Rickon Jon Bran Arya numbers = [56,98,23,12,45] numbers.sort(reverse = True ) print (*numbers) 98 56 45 23 12 Lists Task 11 (Sorted Fruit ) Example solution: Use a for loop to append six fruits to an empty list. Sort the list into alphabetical order and print it. Enter a fruit: strawberry Enter a fruit: kiwi Enter a fruit: lemon Enter a fruit: pear Enter a fruit: orange Enter a fruit: mango Sorted fruit: kiwi lemon mango orange pear strawberry Searching Through Lists A simple if statement can be used to see if a certain value appears within a list. names = [ "Alex" , "Bill" , "Charlie" , "Darla" ] name = input ( "Enter a name: " ) if name in names: print ( "Yes," , name , "is in the list." ) else : print ( "Sorry," , name , "is not in the list." ) Enter a name: Bill Yes, Bill is in the list. Enter a name: Sadie Sorry, Sadie is not in the list. Lists Task 12 (Packed Suitcase ) Example solutions: Create a list with five items to take on holiday. Ask the user to input an item and use an if statement to check if it is or isn't in the list. What should I pack? sun cream I've already packed sun cream What should I pack? toothpaste Whoops! I forgot to pack toothpaste Calculating the Sum of a List To calculate the sum of a list of numbers there are two methods. Using Python's built-in sum function : numbers = [1,4,2,3,4,5] print ( sum (numbers)) Both methods will result in the same output : 19 Using a for loop to cycle through each number in the list and add it to a total . numbers = [1,4,2,3,4,5] total = 0 for number in numbers: total = total + number print (total) Lists Task 13 (Sum and Average ) Example solution: Use a for loop to ask the user to input 5 numbers and append each to a list. Use the sum command to output the total and use it calculate the average . Enter a number: 6 Enter a number : 7 Enter a number : 6 Enter a number : 9 Enter a number : 4 The total is 32 The average is 6.4 Extending a List .extend() can be used in a similar way to .append() that adds iterable items to the end of a list . This commands works well with the choice command (imported from the random library ) to create a list of characters that can be randomly selected. The code below adds a lowercase alphabet to an empty list and then, depending on the choice of the user, adds an uppercase alphabet too. The choice command is used in a loop to randomly select 5 characters. Using .extend() to make a random 5-character code from random import choice list = [] list. extend ( "abcdefghijklmnopqrstuvwxyz" ) upper = input ( "Include uppercase letters? " ) if upper == "yes" : list. extend ( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) code = "" for number in range (5): letter = choice (list) code = code + letter print ( "Your five character code is" , code) Possible outputs: Include uppercase letters? yes Your five character code is yPfRe Include uppercase letters? yes Your five character code is GJuQw = Include uppercase letters? no Your five character code is gberv Extend treats each character as an indidual item whereas append adds the whole string as a single entity . Most of time append would be used, but extend is suitable for a password program as additional individual characters can be added to a list depending on the parameters (e.g. lowercase letters, uppercase letters, numbers and special characters). list = [] list. extend ( "ABCD" ) list. extend ("EFGH" ) print (list) list = [] list. append ( "ABCD" ) list. append ("EFGH" ) print (list) ['A','B','C','D','E','F','G','H'] ['ABCD' , 'EFGH'] = = Practice Task 14 Use the code above (for a 5-character code ) to help you make a password generator . Ask the user if they want uppercase letters , numbers and special characters and use the extend command to add them to a list of characters if they type yes (you should extend lowercase characters into an empty list regardless, like in the code above). Use a for loop and the choice command (imported from the random library) to randomly generate a 10-character password . Example solutions: Include uppercase letters? yes Include numbers? yes Include special characters? yes Your new password is RjWSbT&gW5 Include uppercase letters? no Include numbers? yes Include special characters? no Your new password is hdf8se9y2w ⬅ Section 7 Practice Tasks 8b - 2D Lists ➡
- App Inventor 2 | The Basics | CSNewbs
Learn how to use App Inventor 2 to create simple programs. Perfect for key Stage 3 students to experiment with block coding and objects What is App Inventor? App Inventor 2 Link App Inventor 2 is software developed by Massachusetts Institute of Technology (MIT ), a research university in America. It allows users to create simple apps and learn about the way that they work in a fun manner. There is no need to learn how to program with text editors as everything is based around blocks, a bit like Scratch. To open App Inventor 2 (the current version of the program) click the button in the top right. You will need to log in with a Google account. There are two layouts to App Inventor, Designer and Blocks . You can switch between them with the bottoms in the top right corner. This guide will show you how to make seven simple programs and introduce you to programming concepts such as variables and properties . Download all App Inventor images you will need for the 7 tasks by clicking the camera icon. Note to Computer Science Teachers - The easiest way to test programs made using App Inventor 2 is using the emulator which should be pre-installed by the IT technician team at your school. See here for information on how to set it up. Also, Google accounts are required to access and use App Inventor 2. Viewer - This is a mock-up of what your app will look like. Components - Each component can be renamed or deleted here. Designer Layout Palette - Drag the component that you want to use in your app, into the centre. Properties - Edit the settings for each component. Media - Upload images and sound here before they can be used in your app. Blocks Layout Viewer - This is space for you to drag blocks to make things happen. Blocks - Drag the code block that you want to use into the centre. The blocks connect together like in Scratch. Warnings - Any errors with your code will be displayed here. Backpack - Drag code into to backpack to store it for later. KS3 Home Tasks 1 & 2
- 2.1 - Primary Storage - OCR GCSE (J277 Spec) | CSNewbs
Learn what an embedded system is and about different examples of embedded systems. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 2.1: Primary Storage (Memory) Exam Board: OCR Specification: J277 Watch on YouTube : Primary Storage RAM and ROM Virtual Memory Primary vs Secondary Storage Storage in a computer system is split into two categories: Primary Storage: Very quick because it is directly accesse d by the CPU . Typically smaller in storage size . Sometimes called ‘main memory’ . Includes RAM and ROM . Volatile vs Non-Volatile Storage Storage is also split into two types - volatile and non-volatile . Volatile storage is temporary - data is lost whenever the power is turned off . Example: RAM Non-volatile storage saves the data even when not being powered . Data can be stored long-term and accessed when the computer is switched on . Example: ROM Why do Computers need Primary Storage? Primary storage is low-capacity , internal storage that can be directly accessed by the CPU . Program instructions and data must be copied from the hard drive into RAM to be processed by the CPU because primary storage access speeds are much faster than secondary storage devices like the hard drive. Types of Primary Storage (Memory) Random Access Memory (RAM) Read-Only Memory (ROM) RAM is volatile (temporary) storage that stores all programs that are currently running . RAM also stores parts of the operating system to be accessed by the CPU. RAM is made up of a large number of storage locations, each can be identified by a unique address . ROM is non-volatile storage that cannot be changed . ROM stores the boot program / BIOS for when the computer is switched on. The BIOS then loads up the operating system to take over managing the computer. RAM ( R andom A ccess M emory) ROM ( R ead O nly M emory) Virtual Memory Programs must be stored in RAM to be processed by the CPU . Even if there is insufficient space in RAM for all programs the computer can use the hard disk drive (HDD ) as an extension of RAM - this is called virtual memory . If new data is needed to be stored in RAM then unused data in RAM is moved to the hard drive so the new data can be transferred into RAM . If the original data is required again, it can be moved back from virtual memory into RAM . Using virtual memory is beneficial because it allows more programs to be run at the same time with less system slow down . Secondary Storage: ( Section 2.2 ) Slower because it is not directly accessed by the CPU . Typically larger in storage size . Used for the long-term storage of data and files because it is non-volatile . Includes magnetic , optical and solid state storage. Q uesto's Q uestions 2.1 - Primary Storage (Memory): 1. Describe the differences between primary and secondary storage . [ 6 ] 2. Explain the difference between volatile and non-volatile storage . State an example of both types. [ 4 ] 3. Explain why the computer requires primary storage . [ 2 ] 4. For each type of memory below, describe it and state what information is stored within it: a . Random Access Memory (RAM) [3 ] b. Read-Only Memory (ROM) [ 3 ] c. Virtual memory [ 3 ] 1.3 - Embedded Systems Theory Topics 2.2 - Secondary Storage
- Python | 1b - Commenting | CSNewbs
Learn how to comment in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 1b - Commenting Writing Comments To annotate your work, you can write a comment using the # symbol. Comments are ignored when you run the program and they are not printed . #This is a comment! print ( "Welcome to Python!" ) #The code above prints a nice greeting = Welcome to Python! Programmers use comments to explain to other people (and themselves) what different sections of code do . With massive programs, comments are vital; otherwise, it would be too confusing, especially after returning from a few weeks or months on a different project. If you are creating a Python project for school (or A-Level Computer Science coursework), you will need comments to explain your code and prove you have written it yourself. Comments over Multiple Lines Have a lot to say in one comment? Use three apostrophes ( ”’ ) at the start and three more at the end of your comment like below: '''This is a comment that I have spread out over more than one line''' print ( "Hello! How are you?" ) Top Tip: Use multi-line comments when testing a program to ‘blank out’ sections that you know work fine and only focus on one part at a time. Commenting Task 1 (Day of the Week & Weather) On line 1 write a single-line comment ( use # ) to state that your program will print the day of the week. On line 2 print the current day of the week. On lines 3, 4 and 5 write a multi-line comment (use ''' ) about the weather today. Remember comments won't be printed so only the day of the week should be output. Example solution: Wednesday ⬅ 1a - Pri nting 1c - Crea ting Variables ➡







