Data types

Easy
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
Question 36
Easy

State the most suitable data type for the following variables used in the algorithm described in Figure 1.

Figure 1

cartTotal ← USERINPUT
membershipYears ← USERINPUT
discountPercent ← 0.0
statusText ← "Non-member rate applied"
errorMsg ← "Invalid cart amount"
IF cartTotal > 0.0 THEN
    IF membershipYears >= 3 THEN
        discountPercent ← 15.5
        OUTPUT discountPercent
    ELSE
        OUTPUT statusText
    ENDIF
ELSE
    OUTPUT errorMsg
ENDIF
Variable identifierData type
discountPercent
statusText
[2]

Data types Questions

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