DEV Community

Discussion on: Daily Challenge #138 - Do I get a Bonus?

Collapse
 
erezwanderman profile image
erezwanderman

QBasic!

DECLARE FUNCTION CALC$ (salary!, bonus!)
CONST False = 0
CONST True = 1
CLS
PRINT CALC(32, True)
PRINT CALC(32, False)

FUNCTION CALC$(salary, bonus)
    CALC$ = "$" + LTRIM$(STR$(salary * (bonus * 9 + 1)))
END FUNCTION