Course Content
Introduction to JavaScript
Introduction to JavaScript
1. Getting Started
Hello WorldTask - Show some OutputTask - Output Multiple LinesNumbersTask - Working with NumbersTask - Calculate the Speed of a CarTask - Calculate Area of a TrapeziumOutputting Multiple ValuesTask - Meaningful OutputCommentsTask - Adding a commentMulti-Line CommentsTask - Commenting out CodeTask - Coffee Shop SalesWhat is JavaScript anyway?
2. Manipulating Data
Storing DataTask - Declaring a VariableTask - Accessing Data From a VariableTask - Fixing Variable NamesTask - Reassigning a VariableConstantsTask - Declaring & Using ConstantsPerforming Arithmetic On VariablesTask - Making a Salary CalculatorTask - Adjusting Salary with a BonusTypes of DataTask - Declare a Boolean ValueHow different Data Types InteractTask - Concatenating StringsTask - User Profile & Activity Details
3. Conditional Statements
Task - Coffee Shop Sales
Task
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
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 14
Task - Coffee Shop Sales
Task
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
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 14