瀏覽代碼

Homework.5

Marko 2 年之前
父節點
當前提交
56b1e9fdd1
共有 1 個文件被更改,包括 63 次插入0 次删除
  1. 63 0
      file.js

+ 63 - 0
file.js

@@ -59,3 +59,66 @@ function sum(){
    }
    sum()
 
+//    Union
+
+// function aSample(){
+//     a()
+// };
+
+// function cubeSample(){
+//     cube()
+// };
+
+// function avg2Sample(){
+//     avg2()
+// };
+
+// function sum3Sample(){
+//     sum3()
+// };
+
+// function randomSample(){
+//     intRandom()
+// };
+
+// function greetSample(){
+//     greetAll()
+// };
+
+// function sumSample(){
+//     sum()
+// };
+
+let sample = prompt('Введите задание');
+switch(sample.toLowerCase()){
+    case "a": a()
+         break
+    case "cube": cube(2)
+         break
+    case "avg2": avg2(3,4)
+         break
+    case "sum3": sum3(5,6,7)
+         break
+    case "intRandom": intRandom(8,12)
+         break
+    case "greetAll": greetAll("Oleg","Ivan")
+         break
+    case "sum": sum(9,10,11,13,14)
+         break
+}
+
+
+// Union declarative
+
+
+let samplee = {
+    "a": a(),
+    "cube": cube(2),
+    "avg2": avg2(3,4),
+    "sum3": sum3(5,6,7),
+    "intRandom": intRandom(8,12),
+    "greetAll": greetAll('Oleg','Ivan'),
+    "sum": sum(9,10,11,12,13)
+}
+
+