← 全部工具

VuToV-Mykola/goit-js-hw-01

热度 60 更新于 AI 与 Agent

📌 GoIT Homework-JS #1: JavaScript fundamentals - functions, parameters, string templates, and mathematical operations. Three practical tasks: droid order calculator, shipping cost calculator, and CSS box-model width calculator with border-box sizing.

githubauto-collected

安装

暂未验证可直接使用的安装命令,请查看项目官方文档或 Release。

📸 Скріншот проекту

<!-- END:AUTOGEN --

Мої досягнення

<!-- --

Мої сертифікати - Пройшов курс на Sololearn :

SOLOLEARN

JavaScript Homework 01

Task 1. Droid Orders

File: task-1.js

The repair droid sales station is ready to go, all that remains is to write the software for the sales department.

Declare the makeTransaction function, which expects two parameters:

  • quantity — the first parameter, a number containing the number of ordered droids
  • pricePerDroid — the second parameter, a number containing the cost of one droid

Add the code of the function so that it returns a string with a message about the purchase of repair droids:

"You ordered <quantity droids worth <totalPrice credits!"

Where:

  • <quantity is the number of droids ordered
  • <totalPrice is the total cost of the order (cost of all droids ordered)

Test Code

Add the following code after your function declaration to check its correctness: