The Coca-Cola Company requests a system that determines vacation days for to which a worker is entitled, taking into account the following characteristics: Workers with code 1 (Customer service): - With 1 year of service, they receive 6 vacation days. - With 2 to 6 years of service, they receive 14 days of vacation. - After 7 years of service, they receive 20 vacation days. Workers with code 2 (Logistics): - With 1 year of service, they receive 7 vacation days. - With 2 to 6 years of service, they receive 15 vacation days. - After 7 years of service, they receive 22 vacation days. Workers with code 3 (Management): - With 1 year of service, they receive 10 vacation days. - With 2 to 6 years of service, they receive 20 vacation days. - After 7 years of service, they receive 30 days of vacation. Note: The system must request the "Name", "Department Password" and "Seniority" of the worker, then display a message that contain the name of the worker and the vacation days to which he has right.
Script var name = prompt("What is your name?"); var code = parseInt(prompt("Department code?")); var seniority = parseInt(prompt("Seniority?")); var vacationDays = 0; if (code == 1) { if (seniority == 1) { vacationDays = 6; } else if (seniority >= 2 && seniority <= 6) { vacationDays = 14; } else if (seniority > 7) { vacationDays = 20; } } else if (code == 2) { if (seniority == 1) { vacationDays = 7; } else if (seniority >= 2 && seniority <= 6) { vacationDays = 15; } else if (seniority > 7) { vacationDays = 22; } } else if (code == 3) { if (seniority == 1) { vacationDays = 10; } else if (seniority >= 2 && seniority <= 6) { vacationDays