Javascript - Challenge
📖 Read the lesson
Code Life
By Pierre Marsaa
Level-Up Marathon
Zap trains from level 1 to level 8. Each level costs XP: level 1 costs 50 XP, level 2 costs 100 XP, level 3 costs 150 XP, and so on.
1.
For each level from 1 to 8, print
"Level X: Y XP"
where Y is the XP cost of that level
2.
Add each cost to
totalXP
3.
After the loop, print
"Total: Y XP"
↗️
Loading editor...
↶
▶️ Run
↷
💡 Show Solution
Continue