Flashcards
1.2.3 Introduction to programming
Cards in this deck (12)
- 1What is the difference between a variable and constant?Variable can change while the programme is running, a constant cannot change until the programme has stopped
- 2Name all 5 data typesInteger
Real/Floating point
Character
String
Boolean - 3Define all 5 data typesInteger - whole number
Real - decimal number
Character - any single letter or symbol
String - 2 or more characters
Boolean - only two outcomes (true/flase, yes/no, on/off) - 4What does MOD do?Calculates the remainder from a division. EG. 20MOD6 gives 2
- 5What does DIV do?Counts the number of whole numbers in a division. EG. 20DIV6 gives 3
- 6What does XOR mean?In a comparison only ONE can be true
- 7What is the outcome of NOT(2==2)?False
- 8Arithmetic Operators (7)+ Add
- Subtract
* Multiplication
/ Division
MOD Modulus
DIV Quotient
^ Exponentiation - 9Comparison Operators (6)== Equal to
!= Not equal to
< Less than
<= Less than or equal to
> Greater than
>= Greater than or equal to - 10Logic Operators (4)AND - Both are true
OR - At least one is true
NOT - Flips the outcome
XOR - Only one can be true - 11What does (variable.length) do?Outputs the number of characters in a string. INCLUDES SPACES
- 12What does (variable.substring(4,2)) do?Counts along to the fourth character (starts at 0) and print the next two charcaters
Information
- Description
- A level Computing Flashcards on 1.2.3 Introduction to programming, created by Abbie Devaney on 12/09/2017.
- Created by
- Abbie Devaney
- Views
- 3
- Rating