โ† All ICAS Flashcard Decks

Programming and Digital Systems Flashcards

6 cards from real ICAS practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Programming and Digital Systems flashcards as text
  1. In a computer program, a special container is used to store a value that can be changed later. For example, it could hold a player's score, which starts at 0 and increases. What is this container called?

    Answer: A variable

    A variable is a named storage location in a program that holds a value which can be changed during the program's execution. A constant holds a value that does not change, a function is a block of code that performs a task, and an operator is a symbol like '+' or '-' that performs an operation.

  2. Computers process and store all information using a base-2 number system. What is the name of this system and which two digits does it use?

    Answer: Binary, using 0 and 1

    The binary number system is the fundamental language of computers. It is a base-2 system that uses only two digits, 0 and 1, to represent all data.

  3. Consider the following sequence of instructions: 1. SET a TO 5 2. SET b TO 10 3. SET a TO a + b 4. SET b TO a - b After all instructions are executed, what is the final value of 'b'?

    Answer: 5

    1. 'a' is 5. 2. 'b' is 10. 3. 'a' becomes its current value (5) plus 'b' (10), so 'a' is now 15. 4. 'b' becomes the new value of 'a' (15) minus the old value of 'b' (10), so 'b' is now 5.

  4. A programmer wants to write a set of instructions that repeats a specific action exactly 50 times. Which of the following programming structures is the most appropriate for this task?

    Answer: A FOR loop

    A FOR loop is a control structure used for definite iteration, meaning it repeats a block of code a known number of times. An IF-ELSE statement is for making decisions, not for repetition.

  5. In digital electronics, a specific logic gate will only output a 1 (TRUE) if BOTH of its inputs are 1 (TRUE). If either input is 0 (FALSE), the output is 0 (FALSE). Which gate is this?

    Answer: AND gate

    An AND gate performs a logical 'and' operation. Its output is true only when all of its inputs are true. An OR gate is true if at least one input is true, and a NOT gate inverts its single input.

  6. A user is asked to enter their age into a program. The program then follows this logic: IF age < 18 THEN DISPLAY "Child ticket" ELSE DISPLAY "Adult ticket" END IF If the user enters the age 18, what will the program display?

    Answer: Adult ticket

    The condition checks if the age is LESS THAN 18. Since 18 is not less than 18, the condition is false. Therefore, the program executes the code in the ELSE block and displays "Adult ticket".

Programming and Digital Systems Flashcards โ€” ICAS Study Cards with Answers