ok
This commit is contained in:
parent
9064e35f3f
commit
4c531b5ae7
371 changed files with 338 additions and 316 deletions
|
@ -0,0 +1,26 @@
|
|||
|
||||
|
||||
```js run demo
|
||||
function Calculator() {
|
||||
|
||||
this.read = function() {
|
||||
this.a = +prompt('a?', 0);
|
||||
this.b = +prompt('b?', 0);
|
||||
};
|
||||
|
||||
this.sum = function() {
|
||||
return this.a + this.b;
|
||||
};
|
||||
|
||||
this.mul = function() {
|
||||
return this.a * this.b;
|
||||
};
|
||||
}
|
||||
|
||||
var calculator = new Calculator();
|
||||
calculator.read();
|
||||
|
||||
alert( "Сумма=" + calculator.sum() );
|
||||
alert( "Произведение=" + calculator.mul() );
|
||||
```
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue