forked from sweko/sedc4-javaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparams.json
1 lines (1 loc) · 3.8 KB
/
params.json
1
{"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* 1 => \"One\"\r\n* 2 => \"Two\"\r\n* 11 => \"Eleven\"\r\n* 21 => \"Twenty one\"\r\n* 192 => \"One hundred ninety two\"\r\n* 1187 => \"One thousand one hundred eighty seven\"\r\n* 2000 => \"Two thousand\"\r\n* 21011 => \"Twenty one thousand eleven\"\r\n* 12341678 => \"Twelve million three hundred forty one thousand six hundred seventy eight\"\r\n* 128341679901 => \"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* 1 => \"Еден\"\r\n* 2 => \"Два\"\r\n* 11 => \"Единаесет\"\r\n* 21 => \"Дваесет и еден\"\r\n* 192 => \"Сто девеесет и два\"\r\n* 1187 => \"Илјада сто осумдесет и седум\"\r\n* 2000 => \"Две илјади\"\r\n* 21011 => \"Дваесет и една илјада единаесет\"\r\n* 12341678 => \"Дванаесет милиони триста четериесет и една илјада шестотини седумдесет и осум\"\r\n* 128341679901 => \"Сто дваесет и осум милијарди триста четериесет и еден милион шестотини седумдесет и девет илјади девестотини и еден\"\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}