Skip to content

Commit 94579a1

Browse files
authored
Merge pull request mouredev#7016 from caterinarodriguezdev/27-javascript
#27 - javascript
2 parents 1a7898d + 38992af commit 94579a1

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

Roadmap/27 - SOLID OCP/javascript/caterinarodriguezdev.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,33 @@ const rectangle = new Rectangle(10, 10);
7171
const circle = new Circle(10);
7272

7373
console.log(rectangle.area());
74-
console.log(circle.area());
74+
console.log(circle.area());
75+
76+
77+
console.log('--------------DIFICULTAD EXTRA------------');
78+
79+
class Calculadora {
80+
81+
sumar(n1, n2) {
82+
return n1 + n2
83+
}
84+
85+
restar(n1, n2) {
86+
return n1 - n2
87+
}
88+
89+
multiplicar(n1, n2) {
90+
return n1 * n2
91+
}
92+
93+
dividir(n1, n2) {
94+
return n1 / n2
95+
}
96+
}
97+
98+
const calculadora = new Calculadora();
99+
console.log(calculadora.sumar(1, 1));
100+
console.log(calculadora.restar(1, 1));
101+
console.log(calculadora.multiplicar(1, 1));
102+
console.log(calculadora.dividir(1, 1));
103+

0 commit comments

Comments
 (0)