Data types

Easy
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
Question 46
Easy

An algorithm is used to determine the watering schedule for a garden based on the season.

Figure 1

1      season ← USERINPUT
2      IF season = 'spring' THEN
3          p ← 3
4      ELSE IF season = 'summer' THEN
5          p ← 5
6      ELSE IF season = 'autumn' THEN
7          p ← 2
8      ELSE
9          OUTPUT 'Invalid season'
10     ENDIF
11     FOR i ← 1 TO p
12         OUTPUT 'Watering...'
13     ENDFOR

What is the data type of the variable season in the algorithm shown in Figure 1?

Boolean

Integer

String

Real

Data types Questions

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