-{"name":"Sedc4-javascript","tagline":"Homeworks and assignments for the SEDC CodeCademy 2015/2016","body":"# Homework 1\r\n## JavaScript calculator\r\nYou must create a functional HTML / JavaScript calculator (CSS is allowed, but not mandatory).\r\nIt must have:\r\n- a output display where the result is displayed\r\n- buttons for the digits (0-9)\r\n- buttons for the operations (+, -, *, /)\r\n- button for operation execution (=)\r\n- *optional* button for clearance (C)\r\n\r\nThe design of the buttons and the display is not subject to evaluation - but make it look pretty if you know how :) \r\n\r\nThe calculator must support doing operations on (at least) single digit numbers.\r\n\r\nThe division operator must do integer division (9/4 = 2, not, 2.25) \r\n\r\nThe result of the operation must be displayed in the output display - displaying the operation and operands are not required \r\n\r\nThere is a referent implementation at [this location](Homework/Referent/Calculator/calculator.html) \r\n\r\nNote that the referent implementation is just for design overview, as the code is intentionally more complicated than neccessary.\r\n\r\n**Bonus:** - Make the calculator work from the keyboard (number keys enter numbers, enter calculates, escape clears)\r\n\r\n# Homework 2\r\n## Number to words\r\n\r\n### Description:\r\nOur user needs to print invoices for some trinkets she will be selling. She is not good at reading numbers, so we must help her. She wants to enter a number that should be invoiced, and to receive the text that should be put in the \"with words\" part of the invoice. You must help her print the invoices.\r\n\r\nImplement a JavaScript function that will convert a given number to its word representation. The number can be assumed to be an JavaScript integer, in the range [1 - 999,999,999,999], but it would be nice if the function gave/threw out an error message that the input is invalid. Note that there's no need to handle negative numbers - but they should be detected as invalid input.\r\nThe textual representation should be done in English - and you can test with these valid examples:\r\n\r\n# | English\r\n--|----------\r\n1 |\t\t\t\"One\"\r\n2 |\t\t\t\"Two\"\r\n11 |\t\t\t\"Eleven\"\r\n21 |\t\t\t\"Twenty one\"\r\n192 |\t\t\t\"One hundred ninety two\"\r\n1187 |\t\t\"One thousand one hundred eighty seven\"\r\n2000 |\t\t\"Two thousand\"\r\n21011 |\t\t\"Twenty one thousand eleven\"\r\n12341678 |\t\"Twelve million three hundred forty one thousand six hundred seventy eight\"\r\n128341679901 | \"One hundred twenty eight billion three hundred forty one million six hundred seventy nine thousand nine hundred one\".\r\n\r\nThe result should be returned from the function as a result - not displayed directly to the user, alerted or logged to the console. You must use the following signature of the method:\r\n\r\n```javascript\r\nfunction toWords(number) {\r\n // your code here\r\n return result;\r\n}\r\n```\r\n\r\n**Bonus:** - Да се направи истото за македонски јазик\r\n\r\n#\t|\t\tМакедонски\r\n----------------------------------\r\n1\t|\t\t\"Еден\"\r\n2\t|\t\t\"Два\"\r\n11\t|\t\t\"Единаесет\"\r\n21\t|\t\t\"Дваесет и еден\"\r\n192\t|\t\t\"Сто девеесет и два\"\r\n1187\t|\t\"Илјада сто осумдесет и седум\"\r\n2000\t|\t\"Две илјади\"\r\n21011\t|\t\"Дваесет и една илјада единаесет\"\r\n12341678|\t\"Дванаесет милиони триста четериесет и една илјада шестотини седумдесет и осум\"\r\n128341679901| \"Сто дваесет и осум милијарди триста четериесет и еден милион шестотини седумдесет и девет илјади девестотини и еден\"\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
0 commit comments