-
Notifications
You must be signed in to change notification settings - Fork 23
/
index.html
135 lines (105 loc) · 7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>Sedc4-javascript by sweko</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
</head>
<body>
<section class="page-header">
<h1 class="project-name">Sedc4-javascript</h1>
<h2 class="project-tagline">Homeworks and assignments for the SEDC CodeCademy 2015/2016</h2>
<a href="https://github.com/sweko/sedc4-javaScript" class="btn">View on GitHub</a>
<a href="https://github.com/sweko/sedc4-javaScript/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/sweko/sedc4-javaScript/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<h1>
<a id="homework-1" class="anchor" href="#homework-1" aria-hidden="true"><span class="octicon octicon-link"></span></a>Homework 1</h1>
<h2>
<a id="javascript-calculator" class="anchor" href="#javascript-calculator" aria-hidden="true"><span class="octicon octicon-link"></span></a>JavaScript calculator</h2>
<p>You must create a functional HTML / JavaScript calculator (CSS is allowed, but not mandatory).
It must have:</p>
<ul>
<li>an output display where the result is displayed</li>
<li>buttons for the digits (0-9)</li>
<li>buttons for the operations (+, -, *, /)</li>
<li>button for operation execution (=)</li>
<li>
<em>optional</em> button for clearance (C)</li>
</ul>
<p>The design of the buttons and the display is not subject to evaluation - but make it look pretty if you know how :) </p>
<p>The calculator must support doing operations on (at least) single digit numbers.</p>
<p>The division operator must do integer division (9/4 = 2, not, 2.25) </p>
<p>The result of the operation must be displayed in the output display - displaying the operation and operands are not required </p>
<p>There is a referent implementation at <a href="Homework/Referent/Calculator/calculator.html">this location</a> </p>
<p>Note that the referent implementation is just for design overview, as the code is intentionally more complicated than neccessary.</p>
<p><strong>Bonus:</strong> - Make the calculator work from the keyboard (number keys enter numbers, enter calculates, escape clears)</p>
<p><a href="homework1-results.html">Homework Results</a></p>
<h3> Scoring chart </h3>
<ul>
<li>Adherence to all the specified functionalities - 80 points</li>
<li>No JavaScript errors (syntax or logic) - 20 points</li>
<li>Keyboard management - up to 50 points</li>
<li> Other bonus features - up to 50 points</li>
</ul>
<p>The homework is considered done if you have more than 75 points.</p>
<h1>
<a id="homework-2" class="anchor" href="#homework-2" aria-hidden="true"><span class="octicon octicon-link"></span></a>Homework 2</h1>
<h2>
<a id="number-to-words" class="anchor" href="#number-to-words" aria-hidden="true"><span class="octicon octicon-link"></span></a>Number to words</h2>
<h3>
<a id="description" class="anchor" href="#description" aria-hidden="true"><span class="octicon octicon-link"></span></a>Description:</h3>
<p>Our 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.</p>
<p>Implement 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 [0 - 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.
The textual representation should be done in English - and you can test with these valid examples:</p>
<ul>
<li>1 => "One"</li>
<li>2 => "Two"</li>
<li>11 => "Eleven"</li>
<li>21 => "Twenty one"</li>
<li>192 => "One hundred ninety two"</li>
<li>1187 => "One thousand one hundred eighty seven"</li>
<li>2000 => "Two thousand"</li>
<li>21011 => "Twenty one thousand eleven"</li>
<li>12341678 => "Twelve million three hundred forty one thousand six hundred seventy eight"</li>
<li>128341679901 => "One hundred twenty eight billion three hundred forty one million six hundred seventy nine thousand nine hundred one".</li>
</ul>
<p>The 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:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">function</span> <span class="pl-en">toWords</span>(<span class="pl-smi">number</span>) {
<span class="pl-c">// your code here</span>
<span class="pl-k">return</span> result;
}</pre></div>
<p><strong>Bonus:</strong> - Да се направи истото за македонски јазик</p>
<ul>
<li>1 => "Еден"</li>
<li>2 => "Два"</li>
<li>11 => "Единаесет"</li>
<li>21 => "Дваесет и еден"</li>
<li>192 => "Сто девеесет и два"</li>
<li>1187 => "Илјада сто осумдесет и седум"</li>
<li>2000 => "Две илјади"</li>
<li>21011 => "Дваесет и една илјада единаесет"</li>
<li>12341678 => "Дванаесет милиони триста четериесет и една илјада шестотини седумдесет и осум"</li>
<li>128341679901 => "Сто дваесет и осум милијарди триста четериесет и еден милион шестотини седумдесет и девет илјади девестотини и еден"</li>
</ul>
<p><a href="homework2-results.html">Homework Results</a></p>
<h3> Scoring chart </h3>
<ul>
<li>Each of 16 test cases * 5 points - 80 points</li>
<li>No JavaScript errors (syntax or logic) - 20 points</li>
<li>Македонски броеви - up to 50 points</li>
<li>Other bonus features - up to 50 points</li>
</ul>
<p>The homework is considered done if you have more than 75 points.</p>
<footer class="site-footer">
<span class="site-footer-owner"><a href="https://github.com/sweko/sedc4-javaScript">Sedc4-javascript</a> is maintained by <a href="https://github.com/sweko">sweko</a>.</span>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
</footer>
</section>
</body>
</html>