Data types

Easy
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
Question 41
Easy

An algorithm, written using pseudo-code, uses a user-defined RECORD structure to store information about employees.

RECORD Employee
    name : String
    department : String
    salary : Integer
    isFullTime : Boolean
ENDRECORD

emp1 ← Employee('Alice', 'HR', 35000, True)
emp2 ← Employee('Bob', 'IT', 42000, False)
emp3 ← Employee('Charlie', 'Sales', 28000, True)
staffList ← [emp1, emp2, emp3]
maxSalary ← 0
pointer ← 0

FOR i ← 0 TO 2
    IF staffList[i].salary > maxSalary THEN
        maxSalary ← staffList[i].salary
        pointer ← i
    ENDIF
ENDFOR

OUTPUT staffList[pointer].name, ' has the highest salary'

How many different values can the field isFullTime have?

2

4

128

256

Data types Questions

  1. GCSE
  2. /Computer Science
  3. /Data types