Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Task - Coffee Shop Sales | Getting Started
Introduction to JavaScript
course content

Зміст курсу

Introduction to JavaScript

Introduction to JavaScript

1. Getting Started
2. Manipulating Data
3. Conditional Statements

book
Task - Coffee Shop Sales

Завдання

Swipe to start coding

You are helping a coffee shop calculate their sales.

The shop sells coffee for an average of $5 per cup, and customers sometimes pay extra, requiring change to be given.

Your task is to:

  • Include a multi-line comment at the top of your code which describes the program with the following text:
text
  • Write a console.log statement to display the total earnings after selling 7 coffees to a customer (each costs $5). The output must be in the format: Total earnings: X;
  • Write a console.log statement to display how much change a customer should receive after paying $50 for the 7 coffees. (Use the format: Customer change: X);

Example Output:

python

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 14
toggle bottom row

book
Task - Coffee Shop Sales

Завдання

Swipe to start coding

You are helping a coffee shop calculate their sales.

The shop sells coffee for an average of $5 per cup, and customers sometimes pay extra, requiring change to be given.

Your task is to:

  • Include a multi-line comment at the top of your code which describes the program with the following text:
text
  • Write a console.log statement to display the total earnings after selling 7 coffees to a customer (each costs $5). The output must be in the format: Total earnings: X;
  • Write a console.log statement to display how much change a customer should receive after paying $50 for the 7 coffees. (Use the format: Customer change: X);

Example Output:

python

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 14
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Ми дуже хвилюємося, що щось пішло не так. Що трапилося?
some-alt