Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- Decommentare questa parte per il testing
- exports.init = init
- exports.preleva = preleva
- exports.versa = versa
- exports.estrattoConto = estrattoConto
- **/
- var saldo=0,intestatario="";
- const limiteScoperto=-500;
- function init(nome) {
- intestatario=nome;
- saldo=0;
- }
- function preleva(somma){
- if(saldo - somma >= limiteScoperto);{
- saldo -= somma;
- return somma;
- }
- }
- function versa(somma){
- saldo + somma;
- }
- function estrattoConto() {
- return intestatario+": "+saldo+"€";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement