If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Nested conditionals

Problem

A programmer for a music company is developing a program to determine the highest level of certification for an album.
The program needs to follow this table of thresholds for each certification level:
Minimum albums soldCertification
500,000gold
1,000,000platinum
10,000,000diamond
The code segment below uses nested conditionals to assign the certification variable to the appropriate value, but its conditions are missing operators.
certification ← "none"

IF (albumsSold <?> 10000000)
{
    certification ← "diamond"
} ELSE
{
    IF (albumsSold <?> 1000000)
    {
        certification ← "platinum"
    }
    ELSE {
        IF (albumsSold <?> 500000)
        {
            certification ← "gold"
        }
    }
}
Which operator could replace <?> so that the code snippet works as expected?
Choose 1 answer:
🤔