2.2. Programming

Cards (66)

  • What are variables?

    Named memory addresses that holds value (that can usually be changed).
  • What is an identifier?

    A name of a variable.
  • What does a variable do?

    It stores data in a memory location - it can have a single data type, but the contents can be changed throughout running the program.
  • What is a constant?

    It stores data in a memory location - it can have a single data type, and the contents cannot be changed while the program is running.
  • What can an identifier be?

    The name of a:
    1. Variable
    2. Function
  • What is input?

    Entering data into the system.
  • What is output?

    Displaying data from the system.
  • What is an assignment?

    Allocating data to a variable.
  • What is an increment?

    An increase in the value of a variable.
  • What is concatenation?

    Joining two strings or variables together.
  • What are some examples of comparison operators?
    ==, !=, <, <=, >, >=.
  • What is ==?

    Is equal to.
  • What is !=?

    Is not.
  • What is <, or >?

    Smaller than, or bigger than.
  • What is <= and >=?

    Smaller or equal to, and bigger or equal to.
  • What are some examples of arithmetic operators?

    +, -, *, /, and ^.
  • What is + and -?

    Addition and subtraction.
  • What is *?

    Multiplication.
  • What is /?

    Division.
  • What is ^?

    Exponent - the power of...
  • What are some examples of Boolean operators?

    AND, OR, and NOT.
  • What does MOD do?

    Divides the number and returns the remainder.
  • What does DIV do?

    Divides the number and returns the whole number value.
  • What is a sequence?

    Set of code running line by line, in an order.
  • What is selection?

    Code making a decision on which line to run based on a condition.
  • What is iteration?

    Repeating or looping codes.
  • What are the kinds of iterations?

    1. Count controlled - loops a set for a number of times
    2. Condition controlled - loops based on conditions being true or false
  • What is a count controlled iteration?

    FOR.
  • What is a condition controlled iteration?

    While.
  • What are some common data types?
    String, integer, Boolean, real, character.
  • Explain each data type:
    1. String - any value (text, numbers, symbols...)
    2. Integer - holds whole numbers
    3. Boolean - holds true or false
    4. Real - holds decimal numbers
    5. Character - holds a single character
  • What is casting?

    Turning one data type to another.
  • How can we produce a random number in Visual Basics?

    Dim rn As New Random
    Dim num As Integer
    num = rn.Next(1, 6)
  • Input and output in Visual Basics
    • Input - name = Console.ReadLine()
    • Output - Console.WriteLine(name)
  • What are two examples of selections?

    IF and SWITCH.
  • Switch code example

    Switch Case day
    Case "Sat"
    Console.WriteLine("Saturday")
    Case "Sun"
    Console.WriteLine("Sunday")
    End Switch
  • What is a FOR loop?

    A count controlled loop used when you know how many times the code will be repeated.
  • For loop in Visual Basics
    For i = 0 to 9
    Console.WriteLine("Loop")
    Next
  • What is a while loop?

    A condition controlled loop used when you don't know how many times a set of code will be repeated - it will loop the code while the condition is true.
  • What is a DO UNTIL loop?

    A condition controlled loop that is similar and can be used instead of WHILE, however unlike WHILE, it runs at least once.