1_switch_sizes.js 849 B

1234567891011121314151617181920212223242526272829303132
  1. let size = +prompt("Укажите размер верхней одежды:","");
  2. const usaSizeText = 'для США -';
  3. const italySizeText = 'для Италии -';
  4. switch (size) {
  5. case 40:
  6. alert(`${usaSizeText} 6, ${italySizeText} 38`);
  7. break;
  8. case 42:
  9. alert(`${usaSizeText} 8, ${italySizeText} 40`);
  10. break;
  11. case 44:
  12. alert(`${usaSizeText} 10, ${italySizeText} 42`);
  13. break;
  14. case 46:
  15. alert(`${usaSizeText} 12, ${italySizeText} 44`);
  16. break;
  17. case 48:
  18. alert(`${usaSizeText} 14, ${italySizeText} 46`);
  19. break;
  20. case 50:
  21. alert(`${usaSizeText} 16, ${italySizeText} 48`);
  22. break;
  23. case 52:
  24. alert(`${usaSizeText} 18, ${italySizeText} 50`);
  25. break;
  26. case 54:
  27. alert(`${usaSizeText} 20, ${italySizeText} 52`);
  28. break;
  29. default:
  30. alert('Вы указали неверный размер.');
  31. }