Search CSNewbs

246 results found for ""

  • Greenfoot | Common Errors | CSNewbs

    Common Greenfoot Errors Greenfoot Home If the world becomes greyed out and you can't click on anything then an error has occurred. The actor with the error will have red lines on it. When an error occurs, a the problem. over the line and a helpful message will appear to help you solve the issue. red squiggly line will appear underneath Hover your mouse ​ Some of the more common errors (and how to fix them) are listed below: ; expected Every line with a white background must end in a ( ; ) semi colon ) expected You have missed a . Count the number of open brackets and the number of closed brackets on a line and make sure you have an equal number of both. bracket reached end of file while parsing You are missing at least one . curly bracket ( } ) at the end of your program Press enter to move onto a new line at the bottom; you must have a closed curly bracket with a and another closed curly bracket with a . yellow background green background cannot find symbol You have . Greenfoot uses a system where and . Such as isKeyDown not IsKeyDown and not isKeydown. Check your spelling and capitals carefully. typed a command incorrectly commands have no spaces each word after the first word is uppercase Stuck ? If you start typing but can't remember what commands come next, press together to show a that you can use. Ctrl and Space list of all possible commands

  • Programming | CSNewbs

    Programming Topics Python HTML Greenfoot Assembly Language App Inventor 2 Pseudocode & Flowcharts

  • Python | CSNewbs

    Pyt hon Python Newbies was originally a separate site but has now been integrated into this section of Computer Science Newbies. ​ Follow the instructions in each section and try the practice tasks. At the end of each section are larger problems to solve. ​ ​ Sections Pyt hon 0. Setting up Python Installing and Using Python ​ ​ 1. Printing and Variables a. Printing b. Comments c. Creating Variables d. Using Variables Section 1 Practice Tasks ​ 2. Inputting Data a. Inputting Strings b. Inputting Numbers Section 2 Practice Tasks ​ 3. Data Types & Calculations a. Data Types b. Simple Calculations c. Modulo Section 3 Practice Tasks ​ 4. Selection a. If Statements b. Mathematical Operators c. Logical Operators Section 4 Practice Tasks ​ 5. Importing from Libraries a. Random b. Sleep c. Date & Time Section 5 Practice Tasks ​ 6. Loops a. For Loops b. While Loops Section 6 Practice Tasks 7. Subroutines a. Procedures b. Functions Section 7 Practice Tasks ​ 8. Lists a. Using Lists b. 2D Lists c. Dictionaries Section 8 Practice Tasks ​ 9. String Handling a. Basic String Handling b. Number Handling Section 9 Practice Tasks ​ 10. File Handling a. Open & Write to Files b. Read & Search Files c. Split & Edit Files Section 10 Practice Tasks ​ 11. User Interfaces ​ a. Graphical User Interface ​ 12. Authentication a. Error Handling ​ Extended Tasks Extended Task 1 (Pork Pies) Extended Task 2 (Lottery) Extended Task 3 (Blackjack) Extended Task 4 (Vet Surgery)

  • Python | Setting up Python | CSNewbs

    Setting up Python Downloading Python If you are using Python in Computer Science lessons, then your school should already have it downloaded and installed on the school computers. ​ It is a too so you can practice outside of lessons. and can be downloaded from the official website. You should download the most up-to-date version of Python 3 (currently Python 3.9.1). good idea to download it on a home computer Python is free ​ Save the file and then run it to start installing. Official Download Page Using Python When you run the Python application, it will open the shell. This window will of any program you have created. display the outputs ​ Do not type into the shell . ​ Click on the tab then to open the editor. File New File - This displays the outputs of your program. Python Shell . Do not write directly into the shell - All code is written into the editor. Python Editor When you want to test a program press the F5 key (or click the Run tab then Run Module ). The first time you test a program, it will prompt you to save the file. Make sure you save it somewhere you will remember - it is a good idea to create a folder named 'Python' where you can keep all your practice programs. The next page looks at actually creating a program but above shows how code has been typed into the editor and then displayed in the shell. ​ You never need to save the shell window. Also, the editor saves automatically every time you run the program. Opening a Saved Program When you want to re-open and edit a file you have created previously . double-clicking on it won't work ​ on the file and select : Right-click Edit with IDLE 1a - Printing

  • Programming Principles - Eduqas GCSE | CSNewbs

    Programming Principles Exam Board: Eduqas / WJEC Specification: 2016 + Problem Solving There are four stages to (smart problem solving). computational thinking is when you so that it is . Decomposition break a problem down into smaller tasks easier to solve is the process of . Pattern Recognition identifying similar patterns within a problem Abstraction is when you ignore unnecessary information and focus only on the important facts . the final stage as are created to . An algorithm is usually written as or presented as a . Algorithms are step-by-step rules solve the problem psuedo-code flowchart Programming Constructs There are that most programs will contain: three constructs (ideas) of programming Sequence Structuring code into a . logical, sequential order Selection using . Decision making if statements Iteration using or . Repeating code for while loops Variables Large programs are often - with each subroutine having a dedicated purpose. modular split into subroutines are and . Local variables declared within a specific subroutine can only be used within that subroutine ​ . Global variables can be used at any point within the whole program ​ Local variable advantages - only uses memory when that local variable is needed - global variables use memory whether they are used or not. Saves memory as they can only be changed within one subroutine. Easier to debug local variables in other programs. You can reuse subroutines with local variables ​ Global variable advantages (and in multiple subroutines). Variables can be used anywhere in the whole program as they are only declared once. Makes maintenance easier Can be - values that remain the same. used for constants Local & Global Variables Variable Scope & Lifetime The refers to the where the , e.g. a variable with can be . scope of a variable parts of the program variable can be viewed and used global scope accessed anywhere in the program The is the amount of and therefore , e.g. local variables can only be accessed throughout the subroutine they are created in. lifetime of a variable time the variable is stored in memory can be used Constants A variable is data that can change in value as a program is being run. ​ A is as the program is run - it is and remains the same. constant data that does not change in value fixed ​ An example of a constant in maths programs is - it will constantly remain at 3.14159 and never change. pi π π Counts & Rogue Values When using iteration (looping) the loop must eventually be able to stop. A is a that is used to record the (loop number). count variable current iteration ​ A is an that will cause the . For example by typing "Stop" into a loop that asks for numbers. rogue value unexpected value loop to end Self-documenting Identifiers An efficient program will use that immediately in the program. variables with sensible names state their purpose ​ Using variable names like 'TotalNum' and 'Profit' rather than 'num1' and 'num2' mean that without the need for extensive comments. other programmers will be able to work out the purpose of the code Object-Oriented Programming (OOP) is an example of where a programmer is able to code objects that can be visually placed onto a background. is an IDE for Java that you should recognise and must be able to code in. Java object-oriented programming (OOP) Greenfoot ​ You need to know some and be able to recognise them. OOP keywords Superclass A class from which other 'subclasses' will inherit characteristics ; e.g. hippos, crocodiles and polar bears will inherit properties from the Animals superclass. Object A single object from a class ; e.g. one crocodile object from the Crocodile class. Class A set of objects which share the same properties ; e.g. all PolarBears will behave in a similar way. Comment Two / symbols will allow you to write a comment to explain the code . Method A series of instructions that an object will follow . The act() method will loop in Greenfoot when the play button is pressed. uesto's uestions Q Q Programming Principles: ​ Problem Solving What is meant by ' '? Why is it ? [ ] 1. decomposition important 2 What does the term ' ' mean? Why is it ? [ ] 2. abstraction important 2 What is ? [ ] 3. pattern recognition 2 What is an ? [ ] 4a. algorithm 1 What are the of ? [ ] 4b. two ways writing an algorithm 2 ​ Programming Constructs and for the . [ ] 1. Describe draw a diagram 3 programming constructs 6 ​ Variables What is the difference between ? [ ] 1. local and global variables 4 Describe of using . [ ] 2. two advantages local variables 2 Describe of using . [ ] 3. two advantages global variables 2 What is a ? Give an . [ ] 4. constant example 2 Why is it important to use when programming? [ ] 5. self-documenting identifiers 2 What is a ? What is a ? [ ] 6. count rogue value 2 [ ] 7. Explain what is meant by the scope and lifetime of a variable . 2 ​ Object Oriented Programming Describe each of the following (OOP) key terms: 1. object oriented programming Class [ ] a. 2 Superclass [ ] b. 2 Object [ ] c. 2 Method [ ] d. 2 GCSE Topics

  • 4.3 - Binary Calculations - Eduqas GCSE (2020 Spec) | CSNewbs

    4.3: Binary Calculations Exam Board: Eduqas / WJEC Specification: 2020 + What are binary calculations? and are methods of without having to convert them into denary. Binary addition binary subtraction adding or subtracting binary values How to add binary numbers: How to subtract binary numbers: Overflow & Underflow Errors occur when there is to a binary number in the . Overflow and underflow errors not enough space accurately represent bits available What is an overflow error? An occurs when a binary value is to be stored in the . overflow error too large bits available In technical terms, an occurs if a (remainder) is present on the ( ). overflow error carry most significant bit MSB ​ The CPU then sets the to . overflow flag true The ( ) is the (always the one furthest to the ) of a binary value (e.g. 128 for an 8 bit value). most significant bit MSB largest bit left ​ A flag is an alert . It is either on or off. The by the when an overflow occurs. signal overflow flag is turned on CPU What is an underflow error? An occurs when a number is to be stored in the . The value is to be accurately represented in binary. underflow error too small bits available too close to 0 uesto's uestions Q Q 4.3 - Binary Calculations: ​ 1a. Describe the terms ' most significant bit ' and ' flag '. [ 2 ] 1b. Using the terms from 1a , explain what an overflow error is. [ 2 ] 1c. Describe what is meant by an underflow error . [ 2 ] ​ 2. Add together the following binary values. If an overflow error occurs you must state one has occurred. [ a. 01011001 and 01000101 2 2 2 ] [ b. 11011011 and 01011101 2 2 2 ] [ c. 00110110 and 01101011 2 2 2 ] [ d. 11011011 and 01010111 2 2 2 ] [ e. 01101101 and 11010110 2 2 2 ] ​ 3. Subtract the following binary values; put the first value on top of the second value: a. 10011010 and 00011000 2 2 [ 2 ] [ b. 11011011 and 01011101 2 2 2 ] [ c. 01110110 and 01101011 2 2 2 ] [ d. 11011011 and 01010111 2 2 2 ] [ e. 11101101 and 11010110 2 2 2 ] Watch on YouTube Watch on YouTube 4.2 Signed Binary Theory Topics 4.4 - Arithmetic Shift

  • Searching & Sorting Algorithms - Eduqas | CSNewbs

    Sorting & Searching Algorithms Exam Board: Eduqas / WJEC Specification: 2016 + Merge Sort is a sorting algorithm based on the idea of ‘ ’. Merge sort divide and conquer A merge sort , again and again . divides a list into half until each data item is separate Then the items are , but . combined in the same way as they were divided now in the correct order When the again, then the data is in order and the . individual lists are all merged together as one list algorithm will end Bubble Sort This algorithm is based on the . comparison of adjacent data elements ​ . Data elements are swapped if they are not in the correct order A bubble sort is not suitable for large sets of data. Linear Search A is the most simple search algorithm. linear search ​ as if they were all laid out in a . The list . This search is also known as a because the list is searched in a from start to end. . Each data item is searched in order from the first value to the last line does not have to be in any order before it is searched sequential search sequence For large lists , this search is not very efficient Binary Search A binary search is a much as it generally searches through fewer data and is often much quicker - especially for large data sets. more efficient searching algorithm In a binary search, the middle point of the data is selected with each iteration and many data items can be ignored. However, the list of in order before a binary search can take place. data must already be sorted uesto's uestions Q Q Searching & Sorting Algorithms: ​ Linear Search how the would be found in the following list using a : 12, 5, 3, 2, 8, 19, 14, 6 [ ] Explain step-by-step number 8 linear search 4 ​ Binary Search how the would be found in the following list using a : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 [ ] Explain step-by-step number 2 binary search 6 ​ Merge Sort how a would sort the following list of numbers: 4, 8, 5, 1, 3, 6, 7, 2 [ ] Explain step-by-step merge sort 6 ​ Bubble Sort how a would sort the following list of numbers: 3, 2, 6, 4, 1, 4 [ ] Explain step-by-step bubble sort 6 GCSE Topics Watch on YouTube Watch on YouTube Watch on YouTube Watch on YouTube

  • 4.2 - Signed Binary - Eduqas GCSE (2020 Spec) | CSNewbs

    4.2: Signed Binary Exam Board: Eduqas / WJEC Specification: 2020 + What are Sign and Magnitude and Two's Complement? Sign and Magnitude and Two's Complement are both methods of writing positive and negative binary values . ​ Sign and Magnitude is simpler but will cause incorrect answers if used in binary calculations . ​ Two's Complement is more complex but will generate correct answers when used in binary calculations . Sign & Magnitude The ( ) is the of a binary number - the one . most significant bit MSB largest bit furthest to the left The is the - it represents whether the binary value is . MSB sign positive or negative ​ If the then the binary number is . sign is 0 positive ​ If the then the binary number is . sign is 1 negative The represent the - the of the binary number. other bits magnitude value ​ For an , the range is , because only are used to define the magnitude. 8-bit binary number -127 to 127 7 bits Sign & Magnitude: Problems Sign and magnitude is for two main reasons:​ not commonly used by computers Performing (see section ) will often . binary addition and subtraction 4.3 cause a wrong result In the example below, -7 + 3 should equal -4 but the result given is 2. + Sign and magnitude creates - which is incorrect. two different values for 0 positive 0 and negative 0 Two's Complement is a method of representing binary values. Two's complement positive and negative It is used often by computers because binary calculations will work correctly and there is only one value for zero. Two's Complement: Denary to Binary To represent a negative value using two's complement follow these steps: ​ Write out the . positive value in binary Start on the and move along, until you . The too. right-hand side copy all 0s get to the first 1 first 1 is copied the first 1 (change to its ). So and . After invert each value opposite 0 becomes 1 1 becomes 0 1. 2. 3. Two's Complement: Binary to Denary To convert a binary number to denary you must remember that the . using two's complement MSB is a negative value ​ Just to work out the . add the numbers with 1 together denary value uesto's uestions Q Q 4.2 - Signed Binary: ​ Sign & Magnitude Using , convert the following values to : 1. sign and magnitude denary a. 00011101 b. 11100011 c. 10110110 [ d. 01001111 1 each ] ​ Using , convert the following values to : 2. sign and magnitude binary a. 83 b. -13 c. -102 [ d. -24 1 each ] ​ 3. Describe two problems when using [ sign and magnitude . 4 ] ​ 4. Using sign and magnitude , the range of numbers that can be represented in 6 bits is from - 31 to + 31 . State the range of numbers that can be represented using sign and magnitude in the following bits: a. 8 bits [ b. 4 bits 1 each ] ​ Two's Complement Using , convert the following values to : 1. two's complement binary a. -20 b. -49 c. -87 [ d. -113 2 each ] ​ Using , convert the following values to : 2. two's complement denary a. 10110010 b. 11101110 c. 01101011 [ d. 10011111 2 each ] Watch the to learn how is used to . video sign and magnitude represent negative numbers in binary Watch the to learn how is used to . video two's complement represent negative numbers in binary Watch on YouTube Watch on YouTube 4.1 - Number Systems Theory Topics 4.3 - Binary Calculations

  • 4.1 - Number Systems - Eduqas GCSE (2020 Spec) | CSNewbs

    4.1: Number Systems Exam Board: Eduqas / WJEC Specification: 2020 + What is binary? By now you should know that computer systems process data and communicate entirely in . binary ​ explained different binary storage units such as (a single 0 or 1), (4 bits) and (8 bits). Topic 1.4 bits nibbles bytes ​ Binary is a number system. This means that it only has - . base 2 2 possible values 0 or 1 ​ Because binary is a base 2 number system, binary numbers should be written out with a after them, like this: 1010100 2 2 What is denary? (also known as ) is the number system that you've been using since primary school. Denary decimal ​ Denary is a number system. This means that it has - . base 10 10 possible values 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 ​ Because denary is a base 10 number system, denary numbers should be written out with a after them, like this: 165 10 10 How to convert from binary to denary: How to convert from denary to binary: What is hexadecimal? Hexadecimal is a number system. This means that it has - . base 16 16 possible values 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F ​ Because hexadecimal is a base 16 number system, hexadecimal numbers should be written out with a after them, like this: 6E 16 16 ​ Hexadecimal is used as a because it uses . This makes hexadecimal when , compared to binary. For example, 100111101011 is 9EB . shorthand for binary fewer characters to write the same value less prone to errors reading or writing it 2 16 ​ Double-digit numbers are converted into letters - use the table on the right to help you understand. Hexadecimal only uses single-character values. How to convert from binary to hexadecimal: How to convert from hexadecimal to binary: Converting from denary to hexadecimal / hexadecimal to denary To convert from denary to hexadecimal or the other way round you must . convert to binary first ​ Denary > Binary > Hexadecimal ​ Hexadecimal > Binary > Denary ​ Use the videos on this page if you need help converting to or from binary. ​ The most common number systems question in exams are from denary to hexadecimal or from hexadecimal to denary so make sure that you practice these conversions. uesto's uestions Q Q 4.1 - Number Systems: ​ 1. Explain why hexadecimal numbers are used as an alternative to binary . Use an example . [ 3 ] ​ 2. Convert the following values from binary to denary : a. 00101010 2 b. 11011011 2 c. 01011101 2 d. 11101110 2 e. 01011111 2 [ 1 each ] ​ 3. Convert the following values from denary to binary : a. 35 10 b. 79 10 c. 101 10 d. 203 10 e. 250 10 [ 1 each ] ​ 4. Convert the following values from binary to hexadecimal : a. 11110101 2 b. 01100111 2 c. 10111010 2 d. 10010000 2 e. 11101001 2 [ 1 each ] ​ 5. Convert the following values from hexadecimal to binary : a. C2 16 b. 8A 16 c. DE 16 d. 54 16 e. F7 16 [ 1 each ] ​ 6. Convert the following values from denary to hexadecimal : a. 134 10 b. 201 10 c. 57 10 d. 224 10 e. 101 10 [ 1 each ] ​ 7. Convert the following values from hexadecimal to denary : a. 32 16 b. A5 16 c. 88 16 d. C0 16 e. BE 16 [ 1 each ] 4.2 - Signed Binary Watch on YouTube Watch on YouTube Watch on YouTube Watch on YouTube 3.9 Protection Against Threats Theory Topics

  • 4.4 - Arithmetic Shift - Eduqas GCSE (2020 Spec) | CSNewbs

    4.4: Arithmetic Shift Exam Board: Eduqas / WJEC Specification: 2020 + What is arithmetic shift? Arithmetic shift is used to and . multiply divide binary numbers The effect of is to a binary number. shifting left multiply The effect is by each place that is . doubled shifted x The effect of is to a binary number. shifting right divide ÷ Shifting by has an effect of . 1 2 ​ Shifting by has an effect of . 2 4 ​ Shifting by has an effect of . 3 8 For example, shifting by has an effect of . left 2 places multiplying by 4 Another example: Shifting by has an effect of . right 3 places diving by 8 How to shift a binary number: An may ask you to arithmetically shift a binary number of up to . exam question 16 digits uesto's uestions Q Q 4.4 - Arithmetic Shift: ​ Draw a to show the of a . [ ] 1a. diagram effect multiplying and dividing binary number 2 Draw a to show a shift has for each from . For example, a shift of 1 place has an effect of 2. [ ] 1b. diagram or table the effect place 1 to 4 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

© CSNewbs 2021