The VIP Bouncer
Easy+15 XP
Mission Briefing
The bouncer at the VIP lounge of the Grand Casino needs an automated scanner. Only high-rollers are allowed past the velvet rope.
The Concept: Conditional Logic
Programming is all about making decisions. The most common way to do this is with the if/else statement. It works exactly like a fork in the road: if a condition is true, go one way; if it's false, go the other.
The Objective
Your function receives a parameter amount representing a customer's spending.
- Use an
if/elseblock to check if theamountis 500 or more. - If it is, return: "Eligible for VIP Discount"
- If it is strictly less than 500, return: "Standard Pricing"
01EXAMPLE 1
Input
amount = 600Output
"Eligible for VIP Discount"02EXAMPLE 2
Input
amount = 250Output
"Standard Pricing"Constraints
- Return one of the two specified success/failure strings.
FundamentalsControl FlowLogic
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
amount600
Expected Output
Eligible for VIP Discount
Click RUN to test your solution