Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2.  
  3. <html lang="pl-PL">
  4.  
  5. <head>
  6.  
  7. <meta charset="UTF-8">
  8.  
  9. <script>
  10.     menu=prompt("Wybierz jednostkę \n 1 - Jednostki długości \n 2 - Jednostki masy \n 3 -Jednostki objętości ")
  11.     menu=parseInt(menu)
  12.     if (menu==""){
  13.         alert("nic nie podałeś")
  14.         location.reload()
  15.     }
  16.    
  17.     else if (isNaN(menu)){
  18.         alert("To nie jest liczba ")
  19.         location.reload()
  20.     }
  21.  
  22.     if (menu>3){
  23.         alert("Nie ma takiej opcji ")
  24.         location.reload()
  25.     }
  26.    
  27.     if (menu<1){
  28.         alert("Nie ma takiej opcji ")
  29.         location.reload()
  30.     }
  31.  
  32. switch(menu){
  33.    case 1 :
  34.             alert("Wybrałeś jednostki długości");
  35.             jd=prompt("Wybierz jednostki długości \n A - mile/kilometry \n B - jardy/metry \n C - stopy/metry \n D - cale/centymetry")
  36.                 if (jd==""){
  37.                     alert("Nic nie podałeś")
  38.                     location.reload()
  39.                 }
  40.                
  41.     else if (!isNaN(jd)){
  42.         alert("To jest liczba, masz podać literkę  ")
  43.         location.reload()
  44.     }
  45.    
  46. if (jd>"d"){
  47.     alert("Nie ma takiej opcji ")
  48.     location.reload()
  49. }
  50.        
  51. switch(jd){
  52.     case "a":
  53.         alert("Wybrałeś opcje mile na km")
  54.         ang=prompt("Podaj mile")
  55.             if (ang==""){
  56.                 alert("Nic nie podałeś")
  57.                 location.reload()
  58.             }
  59.            
  60.             else if (isNaN(ang)){
  61.                 alert("Masz podać liczbe mili  ")
  62.                 location.reload()
  63.             }
  64.    
  65.             pl=ang*1.609
  66.             document.write("<h1>"+ang+" mili to "+pl.toFixed(2)+" km</h1>")
  67.     break;
  68.     case "b":
  69.                         alert("Wybrałeś opcje jardy na metry")
  70.                         ang=prompt("Podaj jardy")
  71.                              if (ang==""){
  72.                                 alert("Nic nie podałeś")
  73.                                 location.reload()
  74.                                 }  
  75.                                
  76.     else if (isNaN(ang)){
  77.         alert("Masz podać liczbe jardów   ")
  78.         location.reload()
  79.         }      
  80.                          pl=ang*0.91
  81.                           document.write("<h1>"+ang+" jardów to "+pl.toFixed(2)+" metrów</h1>")
  82.                         break;
  83.         case "c":
  84.                         alert("Wybrałeś opcje stopy na metry")
  85.                         ang=prompt("Podaj liczbe stóp")
  86.                                                  if (ang==""){
  87. alert("Nic nie podałeś")
  88. location.reload()
  89. }
  90. else if (isNaN(ang)){
  91. alert("Masz podać liczbe stóp   ")
  92. location.reload()
  93. }
  94.                          pl=ang*0.30
  95.                           document.write("<h1>"+ang+" stóp to "+pl.toFixed(2)+" metrów</h1>")
  96.                         break;
  97.         case "d":
  98.                         alert("Wybrałeś opcje cale na centymetry")
  99.                         ang=prompt("Podaj cale")
  100.                                                  if (ang==""){
  101. alert("Nic nie podałeś")
  102. location.reload()
  103. }
  104. else if (isNaN(ang)){
  105. alert("Masz podać liczbe cm   ")
  106. location.reload()
  107. }
  108.                          pl=ang*2.54
  109.                           document.write("<h1>"+ang+" cali to "+pl.toFixed(2)+" centymetrów</h1>")
  110.                         break;             
  111.                        
  112.                         }
  113.                         break;
  114.             case 2 :
  115.             alert("Wybrałeś jednostki masy ")
  116.             jm=prompt("Wybierz jednostki masy   \n a- Funty/kilogramy \n b- uncje/gramy \n c- karaty/gramy")
  117.              if (jm==""){
  118. alert("Nic nie podałeś")
  119. location.reload(jm)
  120. }
  121. else if (!isNaN()){
  122. alert("To jest liczba, masz podać literkę  ")
  123. location.reload()
  124. }
  125. if (jm>"c"){
  126. alert("Nie ma takiej opcji ")
  127. location.reload()
  128. }
  129.  
  130.                     switch(jm){
  131.                         case "a":
  132.                         alert("Wybrałeś opcje funty na gramy ")
  133.                         ang=prompt("Podaj funty")
  134.                                                  if (ang==""){
  135. alert("Nic nie podałeś")
  136. location.reload()
  137. }
  138. else if (isNaN(ang)){
  139. alert("Masz podać ilość funtów    ")
  140. location.reload()
  141. }
  142.                          pl=ang*0.45
  143.                           document.write("<h1>"+ang+" funtów to "+pl.toFixed(2)+" gramów</h1>")
  144.                         break;
  145.                          case "b":
  146.                         alert("Wybrałeś opcje uncje na gramy")
  147.                         ang=prompt("Podaj uncje ")
  148.                                                  if (ang==""){
  149. alert("Nic nie podałeś")
  150. location.reload()
  151. }
  152. else if (isNaN(ang)){
  153. alert("Masz podać liczbe uncji   ")
  154. location.reload()
  155. }
  156.                          pl=ang*28
  157.                           document.write("<h1>"+ang+" uncji to "+pl.toFixed(2)+" gramów</h1>")
  158.                         break;
  159.                          case "c":
  160.                         alert("Wybrałeś opcje karaty/gramy")
  161.                         ang=prompt("Podaj karaty ")
  162.                                                  if (ang==""){
  163. alert("Nic nie podałeś")
  164. location.reload()
  165. }
  166. else if (isNaN(ang)){
  167. alert("Masz podać liczbe karatów  ")
  168. location.reload()
  169. }
  170.                          pl=ang*0.2
  171.                           document.write("<h1>"+ang+" karatów "+pl.toFixed(2)+" gramów</h1>")
  172.                         break;
  173.                        
  174.                    
  175.                     }
  176.                     break;
  177.                         case 3 :
  178.                         alert("Jednostek objętości");
  179.                             jo=prompt("Wybierz jednostki \n a- galeony/litry \n b- baryłki/litry")
  180.                              if (jo==""){
  181. alert("Nic nie podałeś")
  182. location.reload()
  183. }
  184. else if (!isNaN(jo)){
  185. alert("To jest liczba, masz podać literkę  ")
  186. location.reload()
  187. }
  188. if (jo>"b"){
  189. alert("Nie ma takiej opcji ")
  190. location.reload()
  191. }
  192.                             switch (jo) {
  193.                                 case "a":
  194.                         alert("Wybrałeś opcje Galeony na litry")
  195.                         ang=prompt("Podaj Galeony")
  196.                          if (ang==""){
  197. alert("Nic nie podałeś")
  198. location.reload()
  199. }
  200. else if (isNaN(ang)){
  201. alert("Masz podać liczbe galeonów   ")
  202. location.reload()
  203. }
  204.                          pl=ang*3.78
  205.                           document.write("<h1>"+ang+" galeonów to "+pl.toFixed(2)+" litrów</h1>")
  206.                         break;
  207.                             case "b":
  208.                         alert("Wybrałeś opcje Baryłki na litry")
  209.                         ang=prompt("Podaj Baryłki")
  210.                                                  if (ang==""){
  211. alert("Nic nie podałeś")
  212. location.reload()
  213. }
  214. else if (isNaN(ang)){
  215. alert("Masz podać liczbe baryłek   ")
  216. location.reload()
  217. }
  218.                          pl=ang*164
  219.                           document.write("<h1>"+ang+" Baryłek to "+pl.toFixed(2)+" litrów</h1>")
  220.                         break;
  221.                             }
  222.             break;
  223.             }
  224. </script>
  225.  
  226. </head>
  227. <body>
  228. </body>
  229. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement