Search CSNewbs
304 results found with an empty search
- 8.4 - Validation & Verification - Eduqas GCSE (2020 Spec) | CSNewbs
Learn about the six main validation checks - range, type, length, format, lookup table and presence. Also, discover three verification checks - double entry, proof-reading and check digits. Based on the 2020 Eduqas (WJEC) GCSE specification. 8.5: Validation & Verification Exam Board: Eduqas / WJEC Specification: 2020 + What are validation and verification checks? Validation is a process to check that data is reasonable or sensible before it is accepted . Verification is the process of checking that data is correct after it has been entered. Validation Checks Range Check Checks data is within a certain range . Age: 34 203 Type Check Checks data is a certain data type . Height (in cm): 182 Two metres Format Check Checks data is entered in a certain way . Date of Birth (DD/MM/YYYY) 25/03/2001 25th March 01 Presence Check Checks that data has actually been entered and not left blank . Password: fluffythecat123 Lookup Table A table of acceptable entries , also known as a list . Length Check Checks the length of the input is within a certain amount. Telephone Number 08323877319 07383 Verification Checks Double Entry Typing in the data twice to make sure there were no spelling errors the first time. Password: fluffythecat123 flufythecat123 Proofreading Checking two copies of data to ensure they are exactly the same . Check Digit Similar to a checksum in a data packet, a check digit is calculated on barcodes to ensure the rest of the numbers are correct . Address: 11 Cherry Lane 11 Cherry Road Confirm Q uesto's Q uestions 8.4 - Validation & Verification: 1. Describe each type of validation check and give an example . a. Range Check [ 3 ] b. Type Check [ 3 ] c. Format Check [ 3 ] d. Presence Check [ 3 ] e. Lookup Table (List) [ 3 ] f. Length Check [ 3 ] 2. For the following data, suggest which validation check would be most suitable and why : a. Password [ 3 ] b. Country of Birth [ 3 ] c. Number of Tickets [ 3 ] d. Weight (in kilograms) [ 3 ] 3. Describe three types of verification check and give an example : a. Double Entry [ 3 ] b. Proofreading [ 3 ] c. Check Digit [ 2 ] 8.4 - Sorting & Searching Theory Topics 9.1 - IDE Tools
- Scratch Maze Game | CSNewbs
This walkthrough will show you how to create a maze game in Scratch . It is split into the following sections: Creating the First Level Choosing the Main Character Animating & Moving the Main Character Back to the Start Adding Score & Time Making Enemies Adding More Levels Extensions Use the links to move between sections easily! 1. Creating the First Level The very first thing to do is to create the level in which our character will move around in! We are going to draw a background from scratch which our hero will run around in to get to the end. Important parts of the pictures are highlighted in yellow ! 1. Select the blank Stage button in the button left to edit the background. Drawing the Background Challenge Task Anchor 1 2. Press on the Backdrops tab. This will show Scratch’s own paint editor on the right. 3. Use the line tool to create straight maze lines on the background. Use the slider at the bottom to increase the width of the line. Remember this is only the first level so don’t make it too difficult. 4. Create a start zone and an end zone with the rectangle tool and then fill them in with the fill bucket tool . You can also change the main background colour using the fill bucket tool. Remember to choose an appropriate level name in the text box at the top. Level Name Rectangle Tool Fill Bucket Tool Make your game more exciting by creating themed levels , like this park background. Other ideas might include a classroom, library or car park. Try switching up the start and end zones by using the circle tool or the line tool and the fill bucket . Come back to this challenge when you are ready to make more levels! 2. Choosing the Main Character Now that you have your first level designed we can make our hero character who is going to navigate the maze and try to get to the end. Picking the main character Anchor 2 1. A character is called a sprite . We will choose a sprite from Scratch’s sprite library . Click on the fairy icon to open the sprite menu. 2. I have selected the Animals category on the left menu. I have chosen the Penguin sprite but choose whichever character you want. 3. Press the Costumes tab and check that your chosen sprite has at least two costumes . We will use these to create animation in the next section to make it look like the sprite is moving. 4. Now that we don’t need the cat anymore we can delete him by right-clicking on his icon and selecting delete . Shrink the Main Character down to size Shrink Tool 5. The sprite is too big for the level background and you will need to shrink them down . Click on the shrink button at the top of the program and then click on the sprite in the paint area to shrink them down. Remember how many times you clicked the sprite to shrink it. You will need to shrink both costumes the same number of times . Here I have shrunk my penguin by 17 clicks when I selected the shrink tool. You can compare the size of your costumes by looking at the image size beneath the icon (e.g. 40 x 53). Picture Size 6. You need to make sure that your sprite is in the centre of the grid otherwise it might cause trouble later when you try to move them. Click on the costume centre button in the top right (it looks like a crosshair ) and drag your sprite into the middle if it is not. Make sure that both costumes are in the centre . Also, give your costumes appropriate names , I have named mine Mr. Penguin 1 and Mr. Penguin 2. Costume Name Costume Centre 3. Animate & Move the Main Character Adding Animation Anchor 3 1. Click on your sprite icon in the bottom left and then on the Scripts tab in the top centre. We will begin using the script blocks and we need to start in the Events category with: ...so drag it over to the script area. This script will run all the blocks that we place beneath it, when the flag is pressed to start the game. 1. 2. You can only add animation if the sprite you chose has at least two different costumes! 2. The second block we need is: ...in the Control category. Every block that we put inside the forever loop block will repeat again and again . We want our character to switch between their costumes infinitely to make it look like they are always walking, which is why we use the forever loop. 3. Click on the Looks category and drag two... ...inside of your forever loop . Use the drop down list (small black triangle on the costume block ) to make one block switch to your first costume and the other block switch to your second costume. 4. In the Control category, drag over two blocks and place one after each of your ‘switch costume to ‘ blocks. 1 second is too long to wait so click on the 1 and change both to 0.5 instead (this is half a second). If you’ve got the code correct so far, when you press the green flag your character should be animated! Moving the Main Character 1. In the Events category drag a into the script area. Change the button from space to ‘up arrow ’ (or any key you like) It is also popular for computer games to use the w key to move up. 2. Click on the Motion category and move over two blocks: and Change the angle of direction from 90 (which is a right turn) to 0 (which is an upwards turn). Now you have just created code to make your character move upwards by ten steps when you press the up arrow! Once you have dragged the blocks when the up arrow is pressed, you can work out how to make your character move down, left and right ALL BY YOURSELF. Add this code in now, before you move on . Rotate the Main Character If you press the green arrow and move your character around you might notice that it doesn't rotate when it moves. Click on the i in the top left of your sprite icon in the bottom left. There are three types of rotation to choose from. Select your preferred style by clicking on one of the three symbols. Full Rotation will turn your sprite up, down, left and right. Horizontal Rotation will only turn your sprite left and right. No Rotation will not turn your sprite at all. it will always appear in the same direction. Anchor 4 4. Back to the Start Starting in the right place We always want the main sprite to start in the green zone when the green flag is pressed to start the game. First drag your sprite to the green zone . Then go to the Motion category and drag over: ...and connect it directly underneath the block you dragged over earlier. Once you’ve added that line of code, click the green flag to make sure that the sprite starts where you want it to . If it doesn’t, then you can change the x (horizontal) and y (vertical) co-ordinates by clicking on the white boxes and changing the values. Back to the start if touching the walls 1. Drag over and connect together the two blocks below: 2. Drag over the two blocks below, put the blue one inside the other and then put them both inside the forever loop : 3. Change the co-ordinates in the blue block you just added so that it matches the same co-ordinates as the block to make the sprite start at the green zone . 4. Now to add the wall detection code! In the Sensing section, drag this block over... ...and put it inside the top of the ‘if then‘ block . Make sure that you put it between the 'if' and 'then' and not underneath. 5. Click once on the box in the ‘touching colour ‘ block and then click the wall or obstacle you want the player to avoid, Now is a good idea to play your game and make sure you can get to the end without being teleported back to the start. If your game is impossible you will need to edit the background – click on the stage icon in the bottom left then the Backdrops tab and edit the walls. Anchor 5 5. Adding Time & Score Recording the Time 1. Click on the Stage icon in the bottom left, we will create new code in the Scripts tab of the stage. DO NOT click the character sprite! Click on the Data category and choose Make a Variable . A variable is something that can change . Call your new variable Time . Adding a Score - The Number of Restarts 2. From the Events category drag: ...then look in the Data category and connect this underneath: ...but it should say Time instead of 'variable'. This code makes the time start at 0 when the game begins. 3. Now we need a loop that increases our variable called Time by 1 every second. First drag over a forever loop : Then place inside of it two blocks: Make sure it says Time instead of variable. Now press the green flag to see the timer go up. 1. In the Data section click on Make a Variable and give it an appropriate name like Restarts . This variable will count how many times we have touched a wall and had to start again. 2. Firstly, go back to the Scripts area for your character – click on the sprite of your main character in the bottom left then the Scripts tab. You need to add two blocks from the Data category: Change variable to Restarts and place it directly underneath the flag. Change variable to Restarts again and place this code directly after the 'go to ' block inside the loop. Now whenever you touch the wall you restart and it records it in the variable called Restarts. 6. Making Enemies Anchor 6 1. Select the fairy icon in the New sprite section to open the Scratch sprite library. 2. From the sprite library choose your enemy . I have selected the polar bear because it fits with my penguin. 3. Select the shrink tool at the top of the program and click on the enemy . Then drag them to where you want them to start . 4. Click on the sprite icon of your enemy then select the Scripts tab. Drag and connect two blocks: 5. From the Control category grab a: ...and place it after the ‘go to ‘ block. Now we will make our enemy glide from his start position to somewhere on our level again and again. Move the enemy to where you want it to go to then add: ...inside the forever loop. Drag another ‘glide ‘ block and place it underneath but change those co-ordinates to the same as the one underneath the the ‘when green flag clicked‘ block. This code makes the enemy move backwards and forwards forever. 6. Make your main character return to the start if they touch the enemy. Click on your main character sprite in the bottom left and then the Scripts tab. You need to copy the exact same code you made earlier to see if the main character is touching the wall , but this time you need to use: ...instead of the touching colour block. Click on the box in the block and select your Main Character . 7. New Levels Anchor 7 Coming Soon To be added soon. This concludes the walkthrough for a Scratch maze game! Try a combination of the suggestions below to add complexity to your game: Using ‘say ‘ or ‘think ‘ blocks in the Looks category to make your sprites say things at certain points (like at the start of a new level). Making your game harder by speeding up enemies in later levels (you could change the number of seconds it takes to glide ) Adding more enemies that only appear in harder levels. Setting a time limit – instead of having your time begin at 0 and increasing by 1 every second, have it start at 30 and decrease by 1 every second. Extensions Anchor 8
- 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: F160: Fundamentals of Application Development Certificate: Computing: Application Development (H029 / H129) Unit F160: Fundamentals of Application Development These pages are based on content from the OCR Cambridge Advanced National in Computing (AAQ) specification . Unit F160 YouTube Playlist Topic 1: Types of Software 1.1 - Programs and Applications 1.2 - Operating Systems 1.3.1 - Application Types 1.3.2 - Application Software Categories 1.3.3 - Application Software Types Topic 2: Software Development Models 2.1 - Software Development Models 2.2 - Development Phases Topic 3: Planning Development Projects 3.1 - Planning Projects 3.2 - Project Planning Tools Topic 4: Application Design Scoping 4.1 - Gathering Client Requirements 4.2 - Client Requirement Specifications 4.3 - Decomposition Methods Topic 5: Human-Computer Interface 5.1.1 - Types of Human-Computer Interaction (HCI) 5.1.2 - Types of Devices 5.2 - HCI Visual Design Considerations 5.3 - HCI Design Documents & Diagrams Topic 6: Job Roles & Skills 6.1 - Job Roles 6.2 - Communication Skills
- Greenfoot Guide #2 | Arrow Key Movement | CSNewbs
Learn how to edit code in Greenfoot to make objects move using the arrow keys. Use methods such as isKeyDown, setRotation and move. Part 2 of the Greenfoot Tutorial for the Eduqas / WJEC GCSE 2016 specification. Right-click on your main character class and select ' Open editor '. The editor allows you to write different methods - actions that the class can perform. The act() method will repeat whenever the Run button is pressed. 1. Open the Code Editor 2. Movement with the Arrow Keys Greenfoot Tutorial Watch on YouTube: 2. Copy the Code CAREFULLY You need to use an if statement to check if a certain key (like the right arrow key) is being pressed down . An if statement must be contained in standard brackets . After each if statement, the proceeding code must be typed within curly brackets - see the image on the left . Tip - If the brackets are on the same line then use the standard brackets ( and ) If the brackets are on different lines then use curly brackets { and } Your code must be perfect or it won't work. 'Greenfoot ' requires a capital G and the isKeyDown method most be written with a lowercase i but uppercase K and D . When the right arrow key is pressed the object will change its rotation to 0° which is right . It will also move 1 place in this direction. Rotations in Greenfoot: 3. Code the Other Arrow Keys Directly underneath the if statement for turning and moving right, add the code for turning and moving down . You can see in the diagram above the degrees to rotate in each of the four directions . Write the code to move in all four directions. Ensure you have the correct number of brackets or the program won't start. Remember brackets that start and end on the same line are ( ) and brackets over multiple lines are { } . 4. Compile and Run Click the Compile button at the top of the code editor . Then you can go back to the main Greenfoot window and click Run . Press the arrow keys to test your main character moves . Click on me if you've got an error that you're stuck with. < Part 1 - Setup & Populating the World Part 3 - Movement (Random) >
- Python | 8b - 2D Lists | CSNewbs
Learn how to create and use two-dimensional lists in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 8b - 2D Lists Creating a List with Multiple Dimensions Lists can be given another dimension to hold data that is related to each other . A scenario: Three students have taken two Chemistry tests, and their teacher has recorded the results in a 2-dimensional array (note that Python does not use arrays but uses lists instead): To create this in Python: Printing a 2D List To print the whole list, use a for loop to cycle through each record. I have altered the normal i variable to be 'record', so it is more descriptive: Use the index number to print a specific record . Look at the table above and remember that Python starts counting at 0 so Edward is record 0, Bella 1 and Jacob 2: To print a specific data value, you need to define the record number and then the data index . When using 2D lists, the first value is the row, and the second value is the column . Use the table at the very top to help you visualise this: Practice Task 1 Use the introduction at the top to help you create a 2D list with three friends in the first column, their age in the second column and their favourite colour in the third column. Print the whole list. Then print just the second person's information. Example solution: Searching Through a 2D List To search through a multi-dimensional list then you need to search through each record and then each data element for a specific value: Practice Task 2 Use the 2D list that you created in the first practice task. Ask the user to enter a name. Search through the list and print the record of that person's name. Example solution: ⬅ 8a - Using Lists 8 c - Dictionaries ➡
- 2.3 - Data States | F161 | Cambridge Advanced National in Computing | AAQ
Learn about the three data states - at rest, in transit (in motion) and in use. 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 2.3 - Data States Watch on YouTube : Data States You need to understand the characteristics and uses of the three data states (at rest , in transit (in motion) and in use ) What You Need to Know Data States ? YouTube video uploading soon Q uesto's Q uestions 2.3 - Data States: 1. What? [2 ] 2. What? [1 ] 3. What? [1 ] 4. What? [1 ] ? D id Y ou K now? 2.2 - Data Flow Topic List 3.1 - APIs
- HTML Guide 4 - Hyperlinks | CSNewbs
Learn how to link to other websites by using the anchor tag. 4. Hyperlinks HTML Guide Watch on YouTube: A hyperlink is a link to another web page . In this section, you will link your page to a real website, like Wikipedia. Hyperlinks require the anchor tags and Copy a URL Firstly you need to copy the full web address of the web page that you would like to link your page to. Choose an appropriate web page that relates to your chosen topic. Create the Anchor Tag 4. Close the start of the tag . 1. Open the start of the tag . 2. Type href (stands for hypertext reference ). 3. Paste the URL inside speech marks . 5. Type the text you want the user to click on . 6. Time to close the tag . When you save your webpage and run it in a browser you will be able to click highlighted text to open the website you have chosen. Add at least three different hyperlinks to your webpage. Try to add the 2nd & 3rd links without looking at this page - practise makes perfect. Add a Hyperlink within a Sentence You can also create an anchor tag within a sentence. Hyperlinks are important to link webpages together. Next is time for adding pictures! Either change one of your previous hyperlinks to be in the middle of a sentence or create a new one. 3. Text Tags HTML Guide 5. Images
- 3.2 - Packets & Switching - Eduqas GCSE (2020 spec) | CSNewbs
Learn about the six parts of a data packet and how packet switching works. Based on the 2020 Eduqas (WJEC) GCSE specification. 3.2: Data Packets & Switching Exam Board: Eduqas / WJEC Specification: 2020 + What is a data packet? When sending data across a network, files are broken down into smaller parts called data packets . Whole files are too large to transfer as one unit so data packets allow data to be transferred across a network quickly . Each packet of data is redirected by routers across networks until it arrives at its destination. Data packets may split up and use alternative routes to reach the destination address. When all the packets have arrived at the destination address the data is reassembled back into the original file. Contents of a Data Packet Data packets contain six distinct pieces of data which are used to redirect the packets towards the destination address. Packet Switching vs. Circuit Switching The key difference is that a circuit-switched network sends data along the same route . A packet-switched network sends data packets along different routes . Packet Switching With a packet-switched network the data is split into packets . The data packets are transmitted over a network and may take different routes to its destination. When all the packets have arrived the data is reassembled . The Internet is an example of a packet-switching network. Advantages of Packet Switching: Transmission is more secure as it is harder for a hacker to intercept complete data because it can take different routes . If a network device fails the data packets can take an alternative route . Data packets can be sent efficiently and individually across less busy routes . Disadvantages of Packet Switching: Reassembling the data takes longer because packets may arrive out of order . It is less reliable than circuit switching as some data packets may not reach the destination (this is called packet loss ). Circuit Switching When data is transmitted over a circuit-switched network all of the data takes the same route to the destination address in one continuous stream . The data is quickly reassembled at the destination because it is already in the correct order . The old telephone system is an example of a circuit-switched network. Advantages of Circuit Switching: Reassembling the data is quick because the packets arrive in the order that they were sent. It is more reliable than packet-switching because data is sent in one continuous stream . The transmission is fast and should encounter fewer errors - once the connection has been securely established . Disadvantages of Circuit Switching: Less secure as hackers could intercept the data and more easily access the data as it all takes the same route. Establishing a connection takes time to set up. If any device fails on the route then the whole connection breaks and data transfer will be incomplete. Q uesto's Q uestions 3.2 - Data Packets & Switching: 1. Draw the data packet diagram and label all 6 pieces of information . [ 6 ] 2a. Describe how packet switching works . [3 ] 2b. Describe the advantages of packet switching . [3 ] 2c. Describe the disadvantages of packet switching . [2 ] 3a. Describe how circuit switching works . [3 ] 3b. Describe the advantages of circuit switching . [3 ] 3c. Describe the disadvantages of circuit switching . [3 ] 3.1 - Network Characteristics Theory Topics 3.3 - Network Topology
- Python | Extended Task 5 | CSNewbs
Test your ability to create a more complex program in Python based on a given scenario. Perfect for students learning GCSE Computer Science in UK schools. Extended Task 5 Collection of Colours A new paint company , 'Sparkle and Shine Paint Schemes ' needs a program that can manage the different colours they sell to customers. They currently have a file with many different colours and want a program made with features to add, remove and list the different colours . For this task, you will need to create a document and include the following sections (with screenshots where appropriate): An introduction to explain the Purpose of your program . A List of Requirements for a successful program. Screenshots of your code (with comments in your code to show understanding). Testing – Create a plan to show how you will test your program and then explanations of any errors that you found and how they were fixed . An Evaluation of what worked, what didn’t, and how you met each of your requirements from your original list. Also, discuss further improvements that you could have made to improve your program. Reminders for this task: You will need to create a selection of options for the user to choose from. Subroutines and a while true loop may help. Section 10 will help you to open, write and read from files . Section 10c shows how to remove lines from a file. There are multiple ways to approach this program, and your solution might look different from the example. Break the problem down and focus on one part at a time. Example solution: Use a menu to select the different options using a command word. Download the colours file: Selecting Total will list the number of colours in the file. This should change whenever a new colour is added or one is removed . Selecting Add will allow the user to enter the name of a new colour to be added to the file . Selecting Letter will allow the user to enter a letter . All colours beginning with that letter should be displayed . Selecting Remove will allow the user to enter a colour to be removed from the file . Selecting Random will display a random colour from the file. Selecting End will stop the program. ⬅ Extended Task 4 (Vet Surgery) Extended Task 6 (Word Game) ➡
- 5.2 - Utility Software - OCR GCSE (J277 Spec) | CSNewbs
Learn about different types of utility software including anti-virus, firewall and defragmentation. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 5.2: Utility Software Exam Board: OCR Specification: J277 Watch on YouTube : Utility Software What is utility software? Utility software are dedicated programs used for the maintenance and organisation of a computer system (this is known an 'housekeeping '). Utilities are required to run additional tasks not performed by the operating system . Anti-malware (such as an anti-virus or anti-spyware ), firewall and encryption software are examples of utilities and have been explained in section 4.2 . Data Compression is another utility that has been explained in section 2.5 . Other utility software include backup software , disk checkers , disk formatters and auto-updaters . Defragmentation What is fragmentation and how does it happen? Over time files stored on a hard disk drive may become fragmented - this is when the file is split into parts that are saved in different storage locations . Fragmentation occurs when there is limited contiguous space in which to store a file . This may happen as data is stored and then later deleted on the hard drive . New files are created which may be bigger than the spaces left by the deleted files . The new files are then split up . Fragmentation increases access time - files that are fragmented take longer to load and read because of the distance between the fragments of the file. How does defragmentation work? Empty spaces are collected together on the hard disk drive and file fragments are moved to be stored together. This means that fewer disc accesses are needed (requiring less physical movement ) as file fragments can be read consecutively . What are the effects of defragmentation? A defragmented file takes less time to read and access because the data is stored contiguously . The read/write head of the hard drive does not need to move as far to read the next piece of data because it is in the adjacent memory location , saving time . It also quicker to save new files because there is more free space together so it does not need to split the file and can store the data contiguously . Q uesto's Q uestions 5.2 - Utility Software: 1. Explain what fragmentation is and how a file may become fragmented . [ 3 ] 2. Describe the process of defragmentation . [ 3 ] 3. Explain the effects of defragmenting a hard disk drive. [ 3 ] 5.1 - Operating Systems Theory Topics 6.1a - Impacts of Technology
- 4.4 - Arithmetic Shift - Eduqas GCSE (2020 Spec) | CSNewbs
Learn how binary numbers can be multiplied or divided using arithmetic shift. Understand the effect the shift has on the binary value. Based on the 2020 Eduqas (WJEC) GCSE specification. 4.4: Arithmetic Shift Exam Board: Eduqas / WJEC Specification: 2020 + What is arithmetic shift? Arithmetic shift is used to multiply and divide binary numbers . The effect of shifting left is to multiply a binary number. The effect is doubled by each place that is shifted . x The effect of shifting right is to divide a binary number. ÷ Shifting by 1 has an effect of 2 . Shifting by 2 has an effect of 4 . Shifting by 3 has an effect of 8 . For example, shifting left by 2 places has an effect of multiplying by 4 . Another example: Shifting right by 3 places has an effect of diving by 8 . How to shift a binary number: An exam question may ask you to arithmetically shift a binary number of up to 16 digits . Q uesto's Q uestions 4.4 - Arithmetic Shift: 1a. Draw a diagram to show the effect of multiplying and dividing a binary number . [2 ] 1b. Draw a diagram or table to show the effect a shift has for each place from 1 to 4 . For example, a shift of 1 place has an effect of 2. [4 ] 2. State the effect of the following shifts: a. Shift right by 2 places. b. Shift left by 1 place. c. Shift left 3 places. d. Shift right by 4 places. [ 1 each ] 3. Shift the following binary numbers and state the effect of the shift: a. 10101011 : Shift left by 2 places. b. 11101100 : Shift right by 3 place. c. 00001011 : Shift right by 2 places. d. 01101110 : Shift left by 1 place. [ 2 each ] Watch on YouTube 4.3 Binary Calculations Theory Topics 4.5 - Character Sets & Data Types
- Python | Section 5 Practice Tasks | CSNewbs
Test your understanding of imported commands in Python including random and time. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python - Section 5 Practice Tasks Task One: Random Numbers Ask the user to input 4 different numbers . Put the four variables in a list with square brackets and use the choice command from section 5a to randomly select one. Example solutions: Enter number 1: 10 Enter number 2: 20 Enter number 3: 30 Enter number 4: 40 The computer has selected 30 Enter number 1: 2023 Enter number 2: 2024 Enter number 3: 2025 Enter number 4: 2026 The computer has selected 2026 Task Two: Logging In You will make a program for logging into a system. Print a greeting then ask the user for their name . Wait 2 seconds then print a simple login message with the user’s name . Then print the current time (current hour and minute ). Example solutions: Welcome to Missleton Bank Please enter your name: Steve Steveson Logging you in Steve Steveson The time is 08:02 Welcome to Missleton Bank Please enter your name: Gracie Jones Logging you in Gracie Jones The time is 15:53 Task Three: Random Wait Generate a random number between 3 and 10 to represent seconds . Print this number then print the current hour, minute and second . Wait for the random number of seconds then print the current time again. Example solutions: The random wait will be 6 seconds. The time is 08:17:57 The time is 08:18:03 The random wait will be 3 seconds. The time is 08:21:39 The time is 08:21:42 Task Four: Independence Checker Create a program that displays how many days three specific countries have been independent for. The user will choose either Fiji , Samoa or Australia and the difference between today's date and the day they become independent will be displayed. Fiji became independent on 10th October 1970 . Samoa became independent on 13th December 1962 . Australia became independent on 1st January 1901 . Use the 'Today's Date ' and 'Between Dates ' parts of Section 5c to help you get today's date , make the other three dates and find the difference . Making Samoa's independence date would be samoadate = date(1962,12,13) for example. Example solutions: Enter FIJI, SAMOA or AUSTRALIA to check how long it has been independent for: AUSTRALIA Australia has been independent for 44822 days. Enter FIJI, SAMOA or AUSTRALIA to check how long it has been independent for: FIJI Fiji has been independent for 19338 days. Task Five: Square Root Create a program that asks the user to enter a whole number . Calculate the square root of the number. Round the answer down to the nearest whole number using the floor command. Example solutions: Enter a number: 156 The rounded down square root is 12 Enter a number: 156 The rounded down square root is 12 ⬅ 5e - More Librarie s 6a - For Loops ➡







