HTML Academy
Previous task
Introduction to programming1/15
Back to the list of tasks
  • 1. Career start
  • 2. Making the program a bit more complicated
  • 3. Console log
  • 4. Data types
  • 5. Complex data types
  • 6. Unknown data
  • 7. Variables
  • 8. Declaring and assigning variables
  • 9. Operations
  • 10. Operations order
  • 11. A few more operations
  • 12. Release of Brekkie-meter v0.1, part 1
  • 13. Release of Brekkie-meter v0.1, part 2
  • 14. Summary of “Getting to know JavaScript”
  • 15. First program: MufFit v0.1
Making the program a bit more complicated
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Career start

Congratulations! You are now a qualified programmer on Muffin’s team. How does a cat choose a human for itself? Nobody knows. But once it has chosen you, you need to start showing your best.

Know nothing about programming? No worries, we’ll teach you!

So what will you have to do? Write programs for your whiskered boss in JavaScript. First, you will write simple programs for the console, but will then switch to animating website interfaces.

Let’s take a look at your workplace:

  • On the left is the editor, that’s where you will write code.
  • The console is on the right, that’s where your programs will output the results of their work.
  • By default, programs are run automatically, but you can change it in settings.
  • The list of tasks for the day is in the lower right corner. The tasks that you completed correctly are highlighted.

Everything is set up, including a cup of tea. Let’s go!

First task: write a program for calculating the nutritional value of 50 grams of milk (Muffin’s morning snack).

Let’s do it together. Each program is a set of commands. In JavaScript, commands are separated with a semicolon, ;. To complete the task, enter one command in the console:

50 * (42 / 100);

That’s our program, just one command. But it works!

Comments

  • script.js
JavaScript

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

Console

The code has changed, click “Run” or turn autorun on.

Result

Goalscompleted

Write a program for calculating the caloric content of Muffin’s breakfast:

  1. enter 50 * (42 / 100); in the editor and look at the result in the console.

100 grams of milk contain 42 calories. That’s where the numbers come from.

Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

VISAMastercard

Log in

or

Forgot your password?

Sign up

Sign up

or
Log in

Restore access

Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

Forgot to connect your email to the profile? Email us and we’ll help.