TOPIC

onde ta errado

greitz asked 2 years ago

let quantidade = parseInt(lines.shift());

switch (quantidade) { case 1: console.log(Total: R$ ${(4.00 * quantidade).toFixed(2)});
break;

   case 2:
   console.log(`Total: R$ ${(4.50 * quantidade).toFixed(2)}`);
   break;

   case 3:
   console.log(`Total: R$ ${(5.00 * quantidade).toFixed(2)}`);
   break;

   case 4:
   console.log(`Total: R$ ${(2.00 * quantidade).toFixed(2)}`);
   break;

   case 5:
   console.log(`Total: R$ ${(1.50 * quantidade).toFixed(2)}`);
   break;

   default:
    console.log(`Total: R$ ${(1.50 * quantidade).toFixed(2)}`);

}

This topic was solved and cannot recieve new replies.

  • greitz replied 2 years ago

    eu me resolvi e so trocar

    let [codigo, quantidade] = lines.shift().split(" ").map(item => parseInt(item));

       switch (codigo) {