Kodewick
Start learning →
Basic←→0 / 60

Menu board

#008BasicOutput4 min

On the chalkboard outside the cafe, the prices should line up. Show the Tea and Latte lines: the name takes 8 places, on the left, with left << setw(8), and the price comes right after.

Should show
Tea     3
Latte   5
main.cpp
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

int main() {
    string tea = "Tea";
    int tea_price = 3;
    string latte = "Latte";
    int latte_price = 5;
    // your code here: two lines: the name in 8 places on the left, then the price
    return 0;
}
Ctrl + Enter runs too
Result

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