Kodewick
Start learning →
Starter←→0 / 70

Cup size

#011StarterConditions3 min

Bubble tea comes in three cups: 'S' is 10, 'M' is 12 and 'L' is 15. Write cup_price(size), where size is one of those three letters, to return the price. Small and large are done; only medium is missing.

Examples
cup_price('S')→10
cup_price('M')→12
The functionint cup_price(char size)
main.c
int cup_price(char size) {
    if (size == 'S') {
        return 10;
    }
    // your code here: if size is 'M', return 12
    return 15;
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.