Skip to content

Commit

Permalink
#27 - javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
caterinarodriguezdev committed Nov 14, 2024
1 parent 96aa072 commit 38992af
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion Roadmap/27 - SOLID OCP/javascript/caterinarodriguezdev.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,33 @@ const rectangle = new Rectangle(10, 10);
const circle = new Circle(10);

console.log(rectangle.area());
console.log(circle.area());
console.log(circle.area());


console.log('--------------DIFICULTAD EXTRA------------');

class Calculadora {

sumar(n1, n2) {
return n1 + n2
}

restar(n1, n2) {
return n1 - n2
}

multiplicar(n1, n2) {
return n1 * n2
}

dividir(n1, n2) {
return n1 / n2
}
}

const calculadora = new Calculadora();
console.log(calculadora.sumar(1, 1));
console.log(calculadora.restar(1, 1));
console.log(calculadora.multiplicar(1, 1));
console.log(calculadora.dividir(1, 1));

0 comments on commit 38992af

Please sign in to comment.