rinomina esercizi js

This commit is contained in:
2026-02-12 18:36:35 +01:00
parent f0b6b85b36
commit 60878cf770
150 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
/**
* Esercizio Extra (DEBUG): L'ordine conta
*
* Descrizione:
* Vogliamo dare un bonus a un dipendente se:
* - Ha fatto vendite alte (> 1000) OPPURE ha ottime recensioni (> 4.5)
* - E INOLTRE (condizione obbligatoria) non deve aver ricevuto reclami.
*
* Il codice attuale dà il bonus anche a chi ha reclami, se ha vendite alte. Questo è SBAGLIATO.
*
* Correggi l'espressione aggiungendo le parentesi necessarie per forzare la logica corretta.
*/
let vendite = 2000;
let recensioni = 3.0;
let haReclami = true;
let dirittoBonus = vendite > 1000 || recensioni > 4.5 && !haReclami;
console.log("Diritto al bonus:", dirittoBonus);
// OUTPUT ATTUALE (Errato): true
// OUTPUT ATTESO (Corretto): false