Giter Club home page Giter Club logo

hw11-js-function_constructor's Introduction

  1. Создайте на вашем github репозиторий по следующему шаблону HW#-name. Все результаты нужно запушить в ваш репозиторий и прикрепить ссылку на hillel портале.

  2. Создайте index.html в котором подключите js script.

  3. Создайте README.md с описанием задания.

  4. Сеть фастфудов предлагает несколько видов гамбургеров: маленький (50 тугриков, 20 калорий) средний (75 тугриков, 30 калорий) большой (100 тугриков, 40 калорий) Гамбургер может быть с одним из нескольких видов начинок: сыром (+ 10 тугриков, + 20 калорий) салатом (+ 20 тугриков, + 5 калорий) картофелем (+ 15 тугриков, + 10 калорий) посыпать приправой (+ 15 тугриков, 0 калорий) полить майонезом (+ 20 тугриков, + 5 калорий). При этом начинок можно добавить несколько или не быть совсем.

Напишите программу, рассчитывающую стоимость и калорийность гамбургера. Используй Функцию Конструктор (подсказка: нужна функция конструктор Гамбургер, константы, методы для выбора опций и расчета нужных величин). Пример работы кода: const hamburger = new Hamburger(SIZE_SMALL); // добавляем добавки hamburger.addModifier(TOPPING_MAYO); hamburger.addModifier(POTATO); или для каждой опциональной начинки можно реализовать отдельный метод. // вывод результата console.log("Price with sauce: “ + hamburger.getPrice()); console.log("Calories with sauce: “ + hamburger.getCalories());

hw11-js-function_constructor's People

Contributors

inrectovirtus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.