Hint: Understand the inheritance relationship between `Apple` and `GoldenApple`, focusing on inherited properties, constructor behavior, and method overriding.
CLASS Apple
PROPERTIES:
color = "red"
weight = 150
isRipe = True
FUNCTION constructor(c, w)
SET this.color = c
SET this.weight = w
END FUNCTION
FUNCTION getNutritionValue()
IF this.isRipe THEN
RETURN this.weight * 0.5
ELSE
RETURN 0
ENDIF
END FUNCTION
FUNCTION describe()
PRINT "This is an apple. Color: ", this.color, ", Weight: ", this.weight
END FUNCTION
END CLASS
CLASS GoldenApple INHERITS FROM Apple
PROPERTIES:
magicPower = 100
FUNCTION constructor(c, w, mp)
CALL SUPERCLASS_CONSTRUCTOR(c, w)
SET this.magicPower = mp
SET this.color = "gold"
END FUNCTION
FUNCTION getTotalValue()
baseNutrition = CALL SUPERCLASS.getNutritionValue()
RETURN baseNutrition + this.magicPower
END FUNCTION
FUNCTION describe()
PRINT "This is a GOLDEN apple! Color: ", this.color,
", Weight: ", this.weight, ", Magic Power: ", this.magicPower
END FUNCTION
END CLASS