Search CSNewbs

249 results found for ""

  • 6.1 - Language Levels - Eduqas GCSE (2016 Spec) | CSNewbs

    6.1: Language Levels Exam Board: Eduqas / WJEC Specification: 2016 + There are two types of used within computer systems: programming languages High-Level Languages Why do programmers use high-level languages? ​ igh-level programming languages use code written in a way that is , such as English, making it the language. H similar to a natural human language easier to understand and use ​ Using high-level languages and allows for compared to low-level languages. leads to fewer errors more powerful and complex commands ​ However, a high-level language into machine code (binary) before it can be run, as high-level languages . must be translated cannot be executed directly by the CPU Popular high-level languages: PYT HON C++ Ja v a Visual Basic Low-Level Languages Low-level languages , making it in. do not closely resemble a natural human language harder for humans to understand and write ​ Low-level languages are used when a program must be or when programmers need to write code that , such as device drivers. executed quickly interacts directly with the hardware ​ There are : two types of low-level language Machine Code ​ This is the pure code that computers can . binary directly process and execute ​ It is extremely tedious and machine code. difficult for humans to understand and write ​ However, machine code can be used when a programmer needs to that can't be done in a high-level language. perform a very specific command ​ Machine code will be than high-level programs because it is already in a format the CPU can execute and does . executed faster not need to be translated 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 0101 0100 1010 1010 1010 1010 1111 1110 0010 1001 0100 1001 0010 0111 0111 0101 0011 1010 1000 0101 0110 0111 0000 1010 1010 0011 1101 1001 0010 1101 0010 0100 1001 0011 1010 1001 0101 0101 0010 0101 0111 0101 0101 1000 1011 0111 Assembly Language ​ Assembly language uses to . See the in the programming tab for a list of mnemonics such as , and . specialised command mnemonics perform actions Assembly Language section INP OUT HLT ​ Assembly language is preferred by many programmers over machine code because it is . easier to understand and spot errors ​ It is and, like machine code, can be . faster to execute than high-level languages used to directly control the CPU uesto's uestions Q Q 6.1 - Language Levels: ​ 1a. Describe three reasons why programmers use high-level languages . [ 3 ] Explain of . [ ] 1b. one limitation using high-level languages 2 ​ 2a. Describe a key difference between low-level languages and high-level languages . [ 2 ] [ 2b. Describe when a low-level language would be used instead of a high-level language . 2 ] [ 2c. Describe an advantage and a disadvantage of writing directly in machine code . 2 ] 2d. Describe what assembly language is. Give one benefit to using assembly language instead of machine code and one benefit to using it instead of a high-level language . [ 3 ] ​ 3. Compare high-level and low-level languages by stating which is: a. Easier to understand [ 1 ] b. Requiring translation [ 1 ] c. Quicker to execute [ 1 ] INP STA Number1 OUT HLT Number1 DAT 5.2 - Utility Software Theory Topics 6.2 - Reading Algorithms

  • Python | Extended Task 4 | CSNewbs

    Extended Task 4 Hi, here from . Jacob Mortimer Cats & Dogs Veterinary Surgery ​ There was a last week, and our computer systems were . flood totally destroyed ​ I need you to , using a , that allows my receptionist to: create a program file ​ new animals . Add to the file and . Search through the file print the details of a specific animal Allow a specific animal to be . removed from the file Vet Surgery 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 for a successful program. List of Requirements (with in your code to show understanding). Screenshots of your code comments – Create a to show how you will test your program and then that you found and . Testing plan explanations of any errors how they were fixed An of what worked, what didn’t, and how you met each of your requirements from your original list. Also, discuss that you could have made to improve your program. Evaluation further improvements Reminders for this task: You will need to create a selection of options for the user to choose from. and a may help. Subroutines while true loop Section 10 will help you to and . open, write read from files shows how to edit data in a file. You will need to adapt this code and not write the line that has been selected, instead of writing a modified version of it. Section 10c 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: Entering 1 allows the user to enter the details of a new animal which is saved into the file . ​ Entering 4 will stop the loop and ends the program. Entering 2 allows the user to enter the details of an animal to search for . If the animal is in the file, their details are printed clearly on a new line. Entering 3 allows the user to enter the details of an animal to remove from the file . If the animal is in the file, all lines are transferred into a temporary file except for the line to be removed . Extended Task 3

  • 3.5 - TCP/IP 5-Layer Model - Eduqas GCSE (2016 Spec) | CSNewbs

    3.5: TCP/IP 5-Layer Model Exam Board: Eduqas / WJEC Specification: 2016 + What are networking standards? are rules that across . Standards have been created to can . Networking standards allow computer systems to communicate networks ensure devices exchange data and work together What is the TCP/IP 5-layer Model? The TCP/IP is split into model 5 layers The model is used to as . . visualise the different parts of a network each of the five layers has a specific role ​ is beneficial to programmers as it , making it because e Splitting a network design into layers simplifies design easier to modify and use ach layer and is associated with . has a certain purpose different protocols ​ The five layers are explained below: 5 e.g. browsers ( / ) and email ( ) and file transfer ( ). Allows humans and software applications to use the network HTTP HTTPS SMTP FTP 4 and without errors. TCP breaks the data down into data packets . This layer makes sure the data is sent and received in the correct order reassembled at the destination 3 . The for the data to take in this layer. IP is responsible for addressing and routing data packets optimal route is calculated Also known as the ' '. Internet Layer 2 Ethernet sets out the format of data packets . This layer handles transmission errors and passes . data to the physical layer 1 using This layer converts the data packets into bits so they can be transferred across a physical connection routers and switches . uesto's uestions Q Q 3.5 - TCP/IP 5-Layer Model: 1a. What are networking standards ? [ 2 ] 1b. Describe why network designs are split into layers . [ 2 ] 2. Create a diagram similar to the one above and describe each layer of the TCP/IP 5-Layer Model. [ 10 ] ​ 3. Look at the statements below and name the layer that is being described: a. This layer ensures data packets are sent and received correctly. b. This layer checks for errors in transmission and sets out the data packet format. c. This layer allows software like web browsers to interact with the network. d. This layer transfers bits across a connection using routers. e. This layer uses addresses to ensure data packets take the correct route. [ 5 ] 3.4 - Protocols Theory Topics 3.6 - Hardware & Routing

  • Python | 12 - Error Handling | CSNewbs

    Python 12 - Error Handling Errors When an error occurs in Python, you may see a chunk of red text like this. ​ This is very useful when creating programs as it tells us the exact (10), and its (NameError). line of the error type ​ However, a completed program should have code in place for when an unexpected error occurs – we call this . exception handling General Exception In this example, indented beneath . Python will attempt to run the code try If there are then the code will . no errors stop just before except then the . If an error does occur Exception code will be run If we enter a then the program will execute normally: correct value But if an occurs (such as writing a string when an integer is expected) then the : error Exception code will run You can add the command to your code that will : else execute only if there are no errors If a number is entered then the code will be printed: valid else If a code generating an is entered then the code will be printed: error except Practice Task 1 Create a program that asks the user to input their age. ​ Don't forget to use the int command. ​ Use try and except to print a message if a number is not inputted. Example solution: Specific Exceptions The Exception command used in the section above is for any general error that occurs. You can also for a variety of errors. use specific except commands ​ Below is a program with two different specific exception commands for one try statement: If a occurs, such as when the , then related code will be printed: Value Error wrong data type is entered Or if the user tries to then a will be triggered which prints a relevant response: divide by zero Zero Division Error Other types of exception can be found . here Practice Task 2 Create a program that asks the user to input a number and then divides this value by 999. ​ Create a Value Error and Zero Division Error exception and include an appropriate message in both. Example solution for Zero Division: 11 - Graphical User Interface Extended Task 1

  • Greenfoot Guide | CSNewbs

    A Greenfoot Guide to Creating a Game Greenfoot Home This guide will show you how to create a simple game in Greenfoot. ​ The game will include a controllable main character that must pick up objects and avoid another character. ​ This page is split into the following sections: ​ Starting from Scratch Populate and Save the World Move with Arrow Keys Move Randomly & Bounce on Edge Remove Actors Play Sound / Stop Game Add Counter Extensions According to the 2016 specification, in the Eduqas exam, you will use , despite the fact that Greenfoot is now on . Greenfoot version 2.4.2 version 3.6.1 ​ This means that some newer code won't work! This guide here on version 2.4.2. will work ​ Just make sure you are also - see the download instruction page for help. using version 2.4.2 Starting from Scratch In the Eduqas exam, you will probably be given a scenario with a background and some actors already. Just in case, this introduction section explains . how to start from scratch Open Greenfoot . If you have never used it before then it will already be empty and ready to use. Otherwise, it will automatically load the last project you worked on. For a new project, click ' Scenario ' and then ' New Java Scenario '. New Java Scenario Creating the Main Character Right-click on the class and select ' ' Actor New subclass... Give the new object an appropriate and choose a relevant . name image ​ I have named my class 'Sheep' and selected the sheep.png image. : Create a new Actor subclass each for The you will control (e.g. my sheep) main character to pick up (e.g. my orange) Collectable objects character to avoid (e.g. my elephant) An enemy Now to create a new class for the main character. Populating and Saving the World In the Eduqas programming exam you will probably be given a scenario with a background and some actors already. The easiest task (and you actually get marks for it) is to populate the world with some of the objects save them in place. and New Object Placements on your main character object and select the top option e.g. 'new Sheep()'. Right-click ​ Drag your mouse to the world and click to drop it. ​ Complete the following actions: Place 1 main character object. Place 5 collectible objects. Place 2 enemy objects. Saving the World Once you have populated your world with objects then right-click on the world and select ' '. Save the World ​ This saves the positions of each object so that it won't reset every time you start a new game. Move with the Arrow Keys Is Key Down Time to and code the main character to move. open the editor ​ Right-click on your main character object 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. You need to use an to check if a certain key (like the right arrow key) is being pressed down. if statement ​ An if statement must be contained in . After each if statement, the proceeding code must be typed within - see the . standard brackets curly brackets image on the left ​ - If the then use ( and ) Tip brackets pairs are on the same line standard brackets ​ If the then use brackets pairs are on different lines curly brackets { and } 0 90 180 270 Inside the if statement brackets, type and a full stop then press ; this brings up a . Greenfoot Ctrl and Space bar list of possible commands ​ Select the command and in the brackets type the first key that you are programming (such as "Right", "Left", "Up" or "Down" for the arrow keys. isKeyDown ​ The key name must be in because it is a . speech marks string Within the curly brackets we want to program our main character to set their rotation to a certain direction and to move. ​ Use again to select the correct commands. This stops you from incorrectly entering commands. Ctrl and Space bar ​ If a line of code has a , that line must ; white background end in a semi-colon ​ Use the diagram below for help with how Greenfoot sets out directions. works when you have got the right arrow key working. Test your code Press the button on the main Greenfoot window. Run ​ When you have done the first key, you can copy that code, paste it and edit it for your other keys. ​ The image to the right shows the code for the right and down arrows. Click on me if you've got an error that you're stuck with. Use this code to help you also . add the left and up keys The diagram below shows you how Greenfoot works out . directions Click to see your enemy objects randomly move around the world. Run Move Randomly & Bounce on Edge Random Movement Right-click on your enemy class and select ' Open editor '. The enemy character should always be moving, so start with move(1); ​ Next we will use an if statement to start the random movement. Slight Left ( - 45° ) Slight Right ( 45° ) Straight ( 0° ) Straight ( 0° ) Slight Right ( 45° ) Right ( 90° ) turn(Greenfoot.getRandomNumber(90); turn(Greenfoot.getRandomNumber(90)-45); Click to see your enemy objects randomly move around the world. Run Inside the if statement type Greenfoot and a full stop then press Ctrl and Space Bar to see a list of possible commands . ​ Select getRandomNumber . Type 10 in brackets and less than 1 after (<1) . ​ This code generates 10 random numbers and if it is less than 1 then it will run the proceeding code. If we don't do this, the character will turn too much or too little . Use the Ctrl and Space Bar trick for the turn command and the getRandomNumber command. ​ Type 90 in brackets and subtract 45 ( - 45) after . ​ This code generates a random angle between 0 and 90. The - 45 part is necessary otherwise the character will always move to the right . See the diagram below for an explanation. Bounce at World Edge You may have noticed that the enemy objects can get 'stuck' in the corners or when they hit the edge of the world. ​ In the act() method, below the random movement statement, add this code that checks to see if the object is at the edge, and turns it around (180 degrees) if it is. Click on me if you've got an error that you're stuck with. Remove Objects from the World Removing Objects Open the editor for your main character. ​ Underneath the if statements for using the arrow keys is where we type the removal code . ​ If you have chosen a different collectible object, type the exact name of that class instead of Orange (e.g. Apples or Ants). Press Run and try to grab all of your collectibles! Time to code your if they are touched by the enemy objects! main character to be removed ​ The the code you have already written. removal code is placed beneath ​ Use the but change the class (instead of Orange. I have chosen Sheep. ). same code as you did above class class Removing Objects - Adding danger to your game Click on me if you've got an error that you're stuck with. Press Run and try to avoid the enemies! Add code to if it is by the enemy class. remove your main character touched Play Sounds & Stop the Game Play Audio Files Any sound files that you may need can be found in the 'sounds' folder of your Greenfoot project . In an exam, sounds will be given for you. I have placed a sound I made for when my main character 'eats' an orange - I have placed it inside the same if statement that will remove the orange from the world. Stop the Game When an enemy object 'eats' the main character then the game should be - it is a simple single line of code that you can add to the method in the . stopped istouching enemy class's code Add & Use a Counter Importing a new Counter Select the Edit tab then ' Import class... ' and choose Counter . Then right-click, choose the New Counter() option and drag it into the world. ​ You must right-click on the background and select 'Save the World' once you have dragged the counter into the world. Click on me if you've got an error that you're stuck with. There are two options for using a counter. In most Eduqas Greenfoot exams you will be given a counter class . You can decide whether to use the counter or import a new one . Using the Counter you are given Right-click on the counter, choose the New Counter() option and drag it into the world. ​ You must right-click on the background and select 'Save the World' once you have dragged the counter into the world . Increasing the counter requires just one line of code. ​ Add it within the removal code for your collectible . Increasing the counter requires just one line of code. ​ Add it within the removal code for your collectible . Press Run and check the counter works. This concludes the walkthrough for a simple Greenfoot game! Try a combination of the suggestions below to add complexity to your game: ​ Add - create a second main character and have them move using different keys (e.g. WASD) multiplayer functionality Make the to make it harder. collectibles randomly move Add that if they are picked up. ‘bad’ collectibles decrease the score Make the too. enemies pick up collectibles Have one for player 1 and another for player 2, if the wrong collectible is picked up by a player, have them lose a point. type of collectible Extension Ideas Right-click on the World class and select ' new subclass... '. ​ Chose an appropriate world name, such as MyWorld . ​ Choose an image from the ' backgrounds ' image category, I chose cell.jpg but you can choose any. ​ Click the button in the bottom right to . Compile save the program New World Subclass

  • 8.1 - Translators - Eduqas GCSE (2016 Spec) | CSNewbs

    8.1: Translators Exam Board: Eduqas / WJEC Specification: 2016 + What is a translator? A changes (translates) a program written in one language into another language (usually ). translator machine code There are three : types of translator Assembler An converts into . assembler low level assembly language machine code INP STA 33 INP STA 34 LDA 33 ADD OUT HLT Interpreter An converts into and executes it. interpreter high-level language one line at a time machine code PYT HON Compiler A converts into for execution at a later time. The . compiler high-level language machine code entire program is converted at once PYT HON 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 Differences between an interpreter and a Compiler: Interpreter Compiler Execution Method: An interpreter translates (high level code) into . source code machine code one line at a time ​ Execution Speed: An interpreter is than a compiler because the code must be the program is run. slower reinterpreted each time ​ Complexity: Interpreters are . smaller, simpler programs ​ Error Reporting: In error reporting, the interpreter would encounter the errors and and from running.​ report it to the user immediately stops the program ​ Repetition: Interpreted programs can be edited and run . without translating the whole program Interpreters must it is run. reinterpret the program every time Execution Method: A compiler translates all the (high level code) into in . source code machine code one go A compiler produces an that will run on without the compiler needing to be installed. executable file other machines ​ Execution Speed: Compilers can produce much than interpreters making the . more efficient code compiled programs run faster ​ Complexity: Compilers tend to be . large complex programs ​ ​ Error Reporting: The compiler would , taking note of where errors have occurred and record them in an . analyse the entire program error file ​ Repetition: Compilation requires analysis and the generation of the code , whereas interpreters must re-interpret each time. only once However, compiled programs have to be after any have been made. re-compiled changes x1 ∞ x1 uesto's uestions Q Q 8.1 - Translators: ​ 1. Briefly describe each type of translator : Assembler a. [ 1 ] Interpreter b. [ 2 ] Compiler c. [ 2 ] ​ 2. Compare interpreters and compilers for each of the following features : Execution Method a. Execution Speed b. Complexity c. Error Reporting d. Repetition e. [ 10 total ] 7.1 - IDE Facilities Theory Topics 8.2 - Stages of Compilation

  • 4.5 - Sound Representation - Eduqas GCSE (2016 Spec) | CSNewbs

    4.7: Sound Representation Exam Board: Eduqas / WJEC Specification: 2016 + Converting Analog Sound to Binary To on a computer must be store sound analog sound waves converted in to digital data ( binary ). The sound is sampled using an ADC (Analog to Digital and (such as 01010011) called Convertor) stored as a binary value a . sample 0010 1011 0101 0101 Analog sound wave ADC (Analog to Digital Converter) Binary sample Sampling an Analog Sound Wave Digital sampling is and not continuous like analog waves. discrete (separate) To get the sound, highest quality many samples are taken to recreate the analog wave as . closely as possible Sample Rate The is the . sample rate number of samples taken per second It is measured in (kHz), for example CD quality is 44.1kHz (44,100 kilohertz samples per second). The , the as the digital data more . higher the sample rate better the audio quality closely resembles an analog wave ​ However, because for each individual sample. higher sample rates result in larger file sizes more data is stored A will result in a because the . low sample rate low-quality sound digital data does not closely resemble the original analog wave A will result in a because the . higher sample rate higher-quality sound digital data more closely resembles the original analog wave Improving Audio Quality Bit Depth Bit Rate The is defined as the . It is measured in ( ). bit rate amount of audio data processed per second kilobytes per second kbps The bit rate is calculated by . multiplying the sample rate and bit depth ​ Because the bit rate is the measure of the sample rate and bit depth multiplied together, the . the higher the bit rate higher the quality of the sound The is the number of bits . For example, a sample with a bit depth of 4 could be 0101 or 0111 or 1010. A sample with a bit depth of 8 could be 01010110 or 1010110 or 11001111. A common bit depth is . bit depth available to represent each sample 16 bits The higher the bit depth , the to be used for each sample. Therefore the . more bits are available quality is often higher as the wave more closely resembles an analog wave ​ The if the bit depth is higher, as . file size will also be larger each sample stores additional bits A short audio sample has a and a samples . The clip is . Example: bit depth of 4 sample rate of 10 per second 15 seconds long ​ by : 4 bits x 10 = . Calculate the bit rate multiplying the sample rate and bit depth 40 bits Now that is the correct data for Multiply the by the in the file: 40 x 15 = . one second. bit rate number of seconds 600 bits ​ To convert the answer from , . bits to bytes divide by 8 ​ 600 bits ÷ 8 = . 75 bytes Calculating File Size Metadata for Sound Files ​ Music libraries such as Apple Music or Spotify store a huge amount of on each song. Metadata is such as: metadata additional data about a file Artist Title / Track Title Product / Album Title Track Number Date Created / Year Genre Comments Copyright Software Type Duration File size Bit rate Sampling rate Channels Volume uesto's uestions Q Q 4.7 - Sound Representation: ​ 1. Explain how an analog sound wave is converted into a binary sample . [ 2 ] ​ [ 2a. What is a sample rate ? 1 ] [ 2b. Explain two ways an audio file will be affected if the sample rate is increased . 4 ] [ 3a. What is bit depth ? 2 ] [ 3b. two ways Explain an audio file will be affected if the bit depth is increased . 4 ] 3c. Explain what the bit rate is. [ 2 ] ​ . An audio sample has a , a and it is . What is the file size in ? 4 bit depth of 8 sample rate of 10 12 seconds long bytes [ 2 ] ​ 5a. What is metadata ? [ 2 ] 5b. State four different types of metadata for audio files . [ 4 ] low bit rate = lower quality high bit rate = higher quality Converting Analog Sound to Binary 1 4.4 Graphical Representation Theory Topics 4.6 - Compression

  • 6.2 - Risks | Unit 2 | OCR Cambridge Technicals | CSNewbs

    6.2 - Risks Exam Board: OCR Specification: 2016 - Unit 2 Unauthorised Access to Data As part of the of , data should only be with the to do so. There are two main reasons why data may be viewed by someone who shouldn't - and . security principle confidentiality viewed by individuals authorisation espionage poor information management is the act of collecting data so that it can be - such as a competitor acquiring information about their rival's product before it is launched publicly. Espionage used against an organisation If a company has strategies in place and or then it is more likely to be viewed by unauthorised persons. poor information management data is insecurely stored too many people have access to sensitive information Not only would benefit from unauthorised access, but the ( ) if . competitors Data Protection Act 2018 would also be broken personal data was accessed Accidental Loss of Data Data loss refers to information being - not just a copy of the file but the too so it . One reason for accidental data loss is or a that leads to , such as a database crash or hard drive failure. irretrievably lost original version cannot be accessed in any format equipment failure technical error data corruption is another reason for accidental data loss as an employee might accidentally or discard an important paper document without realising. Human error delete a file ​ If data is accidentally lost then it could mean that hours of data entry and collection will have been for nothing and might such as analysis and trend recognition. Also, if it was personal data that was lost then the of has been and the has been . delay dependent processes security principle availability broken Data Protection Act ( 2018 ) breached Intentional Destruction of Data This is the act of . Examples include that corrupt data so that it can no longer be used and such as (distributed denial of service) attacks or . Ransomware so that they can only be accessed again when certain criteria have been met, usually the affected group having to pay an extortionate . purposely damaging an organisation by deleting or denying access to data viruses targeted malicious attacks DDOS ransomware encrypts files fee When data is intentionally deleted the organisation in question can respond by and any infected computer systems / devices or by and not making the breach public - but having to re-collect / re-analyse the data. Data destruction will usually lead to a as customers won't want to have their information stored in a system they see as . This loss of reputation could lead to . If the loss is ignored and unreported then it could result in a when it is eventually revealed - like Yahoo who only confirmed a massive data breach that happened in 2013, two years later in 2016. This breach affected all 3,000,000,000 Yahoo accounts and is the largest data breach in the history of the internet. replacing the data ignoring the loss loss of reputation unreliable and insufficiently protected customer loss and a decrease in profits huge loss of trust Intentional Tampering with Data This is when data is . This could occur through fraudulent activity such as to change information displayed on a webpage. An example is if a student or a for a better grade. A business example is if a to display larger profits and smaller losses than real figures, to boost investment or please stakeholders. changed and no longer accurate hacking teacher changed exam answers company tampered with financial data ​ If data tampering is found out then it can result in a as that organisation . If has been altered then the of will have been as the data is . Data security methods and if data has been tampered with, especially if it was an external individual that accessed and changed the data. Employees that tamper with data will be and may face . loss of reputation cannot be trusted to report data accurately personal data security principle integrity broken no longer accurate protection systems will also need to be reviewed fired legal action uesto's uestions Q Q 6.2 - Risks: ​ Describe on an organisation for . [ ] 1. two effects each of the four identified risks 8 ​ Research at least above and of that example, such as the Yahoo data breach. [ ] 2. one real-life example for each risk describe the consequences 12 6.1 - Security Principles Topic List 6.3 - Impacts

  • Python | Section 3 Practice Tasks | CSNewbs

    Python - Section 3 Practice Tasks Task One Create a program that asks the user to a number and then the square of that number. input prints ​ Requirements for a complete program: Use only two lines. Use only one line. Include the user's number and the squared number in the print line. print Remember: Break up variables in a print line by using commas or plus signs between each part of the . "sentence" Example solution: Task Two X Create a program that asks the user to two numbers. Multiply the two numbers together and the total. input print Requirements for a complete program: Only three lines. Use only one line. Include the user's number and the squared number in the print line. print Remember: Break up variables in a print line by using commas or plus signs between each part of the . "sentence" Example solution: Task Three Create a program that asks the user to their current age and then a guess of when they will turn 65. (Note this is more likely to be correct towards the end of the year – think about why). input prints ​ You could do this in just two lines but before trying that work out on paper the steps to calculating your own age you will turn 65. What steps did you take? Try to recreate those steps in Python. You might need to create another variable to make it easier. Example solution: 3c - Modulo 4a - If Statements

  • While Loops | CSNewbs

    While Loops while loops - not equal to set default value before loop 'not equal to' symbol password = " " while password != "iamthebest" : password = input ( "What is the password? " ) colon required must indent (tab key) indented lines will be repeated until the while command is not true What is the password? hello What is the password? let me in What is the password? idk What is the password? iamthebest Press F5 to run program: While loops - equal to set value before loop 'equal to' symbol happy = "no" while happy == "no" : q1 = input ( "What is your name? " ) q2 = input ( "What is your age ? " ) q3 = input ( "What is your height ? " ) happy = ( ) input "Are you happy with your answers?" loop repeats if happy is still 'no' What is your name? Steve What is your age? 20 What is your height? 6"1' Are you happy with your answers? no What is your name? Steve What is your age? 21 What is your height? 6"1 Are you happy with your answers? yes Press F5 to run program:

© CSNewbs 2020