1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | #include <iostream> #include <math.h> // C++ program to demonstrate default behaviour of // sort() in STL. #include <bits/stdc++.h> //for sort function //#include <array> #include <cmath> using namespace std; //Fungsi mengurutkan data nilai terendah ke terbesar //sumber: https://www.geeksforgeeks.org/sort-c-stl/ float tabelSW(int r, int c, int display) //Tabel 2 Shapiro Wilk - Probabilitas { float arr[48][9] = { { 0.753,0.756,0.767,0.789,0.959,0.998,0.999,1,1 }, { 0.687,0.707,0.748,0.792,0.935,0.987,0.992,0.996,0.997 }, { 0.686,0.715,0.762,0.806,0.927,0.979,0.986,0.991,0.993 }, { 0.713,0.743,0.788,0.826,0.927,0.974,0.981,0.986,0.989 }, { 0.73,0.76,0.803,0.838,0.928,0.972,0.979,0.985,0.988 }, { 0.749,0.778,0.818,0.851,0.932,0.972,0.978,0.984,0.987 }, { 0.764,0.791,0.829,0.859,0.935,0.972,0.978,0.984,0.986 }, { 0.781,0.806,0.842,0.869,0.938,0.972,0.978,0.983,0.986 }, { 0.792,0.817,0.85,0.876,0.94,0.973,0.979,0.984,0.986 }, { 0.805,0.828,0.859,0.883,0.943,0.973,0.979,0.984,0.986 }, { 0.814,0.837,0.866,0.889,0.945,0.974,0.979,0.984,0.986 }, { 0.825,0.846,0.874,0.895,0.947,0.975,0.98,0.984,0.986 }, { 0.835,0.855,0.881,0.901,0.95,0.975,0.98,0.984,0.987 }, { 0.844,0.863,0.887,0.906,0.952,0.976,0.981,0.985,0.987 }, { 0.851,0.869,0.892,0.91,0.954,0.977,0.981,0.985,0.987 }, { 0.858,0.874,0.897,0.914,0.956,0.978,0.982,0.986,0.988 }, { 0.863,0.879,0.901,0.917,0.957,0.978,0.982,0.986,0.988 }, { 0.868,0.884,0.905,0.92,0.959,0.979,0.983,0.986,0.988 }, { 0.873,0.888,0.908,0.923,0.96,0.98,0.983,0.987,0.989 }, { 0.878,0.892,0.911,0.926,0.961,0.98,0.984,0.987,0.989 }, { 0.881,0.895,0.914,0.928,0.962,0.981,0.984,0.987,0.989 }, { 0.884,0.898,0.916,0.93,0.963,0.981,0.984,0.987,0.989 }, { 0.888,0.901,0.918,0.931,0.964,0.981,0.985,0.988,0.989 }, { 0.891,0.904,0.92,0.933,0.965,0.982,0.985,0.988,0.989 }, { 0.894,0.906,0.923,0.935,0.965,0.982,0.985,0.988,0.99 }, { 0.896,0.908,0.924,0.936,0.966,0.982,0.985,0.988,0.99 }, { 0.898,0.91,0.926,0.937,0.966,0.982,0.985,0.988,0.99 }, { 0.9,0.912,0.927,0.939,0.967,0.983,0.985,0.988,0.99 }, { 0.902,0.914,0.929,0.94,0.967,0.983,0.986,0.988,0.99 }, { 0.904,0.915,0.93,0.941,0.968,0.983,0.986,0.988,0.99 }, { 0.906,0.917,0.931,0.942,0.968,0.983,0.986,0.989,0.99 }, { 0.908,0.919,0.933,0.943,0.969,0.983,0.986,0.989,0.99 }, { 0.91,0.92,0.934,0.944,0.969,0.984,0.986,0.989,0.99 }, { 0.912,0.922,0.935,0.945,0.97,0.984,0.986,0.989,0.99 }, { 0.914,0.924,0.936,0.946,0.97,0.984,0.987,0.989,0.99 }, { 0.916,0.925,0.938,0.947,0.971,0.984,0.987,0.989,0.99 }, { 0.917,0.927,0.939,0.948,0.971,0.984,0.987,0.989,0.991 }, { 0.919,0.928,0.94,0.949,0.972,0.985,0.987,0.989,0.991 }, { 0.92,0.929,0.941,0.95,0.972,0.985,0.987,0.989,0.991 }, { 0.922,0.93,0.942,0.951,0.972,0.985,0.987,0.989,0.991 }, { 0.923,0.932,0.943,0.951,0.973,0.985,0.987,0.99,0.991 }, { 0.924,0.933,0.944,0.952,0.973,0.985,0.987,0.99,0.991 }, { 0.926,0.934,0.945,0.953,0.973,0.985,0.988,0.99,0.991 }, { 0.927,0.935,0.945,0.953,0.974,0.985,0.988,0.99,0.991 }, { 0.928,0.936,0.946,0.954,0.974,0.985,0.988,0.99,0.991 }, { 0.929,0.937,0.947,0.954,0.974,0.985,0.988,0.99,0.991 }, { 0.929,0.939,0.947,0.955,0.974,0.985,0.988,0.99,0.991 }, { 0.93,0.938,0.947,0.955,0.974,0.985,0.988,0.99,0.991 } }; //double n = sizeof(arr) / sizeof(arr[0]); /*Here we take two parameters, the beginning of the array and the length n upto which we want the array to be sorted*/ if (display == 1) { cout << "TABEL 2 SHAPIRO WILK - P-VALUES \n"; cout << "------------------------------------------------------------------------------\n"; cout << "n\\p \t0.01 \t0.02 \t0.05 \t0.1 \t0.5 \t0.9 \t0.95 \t0.98 \t0.99 \n"; cout << "------------------------------------------------------------------------------\n"; for (int r = 0; r < 48; r++) { cout << r+3 << "\t"; for(int c = 0; c < 9; c++) { cout << arr[r][c] << "\t"; } cout << endl; } cout << "------------------------------------------------------------------------------\n\n\n"; } return arr[r][c]; } float tableCofficientA(int r, int c, int display) //n=2-14, a1-a7 { float tabelCoffA[8][16] = { { 0, 0.7071, 0.7071, 0.6872, 0.6646, 0.6431, 0.6233, 0.6052, 0.5888, 0.5739, 0.5601, 0.5475, 0.5359, 0.5251 }, { 0, 0, 0, 0.1677, 0.2413, 0.2806, 0.3031, 0.3164, 0.3244, 0.3291, 0.3315, 0.3325, 0.3325, 0.3318 }, { 0, 0, 0, 0, 0, 0.0875, 0.1401, 0.1743, 0.1976, 0.2141, 0.226, 0.2347, 0.2412, 0.246 }, { 0, 0, 0, 0, 0, 0, 0, 0.0561, 0.0947, 0.1224, 0.1429, 0.1586, 0.1707, 0.1802 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0399, 0.0695, 0.0922, 0.1099, 0.124 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0303, 0.0539, 0.0727 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.024 } }; if (display != 0) { cout << "TABEL 1 (A) SHAPIRO WILK - COFFICIENTS \n"; cout << setfill('-') << setw(118) << "" << setfill(' ') << endl; cout << right << setw(8) << "-\\n= " << left << setw(8) << "1" << setw(8) << "2" << setw(8) << "3" << setw(8) << "4" << setw(8) << "5" << setw(8) << "6" << setw(8) << "7" << setw(8) << "8" << setw(8) << "9" << setw(8) << "10" << setw(8) << "11" << setw(8) << "12" << setw(8) << "13" << setw(8) << "14" << endl; cout << setfill('-') << setw(118) << "" << setfill(' ') << endl; for (int b = 0; b < 7; b++) { for(int k = 0; k < 14; k++) { if (k==0) { cout << left << "a" << setw(7) << b+1; cout << left << setw(8) << tabelCoffA[b][k] ; } else { //cout << tabelCoffA[b][k] << "\t"; cout << left << setw(8) << tabelCoffA[b][k] ; } } cout << endl; } cout << setfill('-') << setw(118) << "" << setfill(' ') << endl << endl << endl; } //cout << tabelCoffA[0][1] << endl << endl << endl; return tabelCoffA[r][c]; } float tableCofficientB(int r, int c, int display) //n=2-14, a1-a7 { float tabelCoffB[14][13] = { { 0.515, 0.5056, 0.4968, 0.4886, 0.4808, 0.4734, 0.4643, 0.459, 0.4542, 0.4493, 0.445, 0.4407 }, { 0.3306, 0.329, 0.3273, 0.3253, 0.3232, 0.3211, 0.3185, 0.3156, 0.3126, 0.3098, 0.3069, 0.3043 }, { 0.2495, 0.2521, 0.254, 0.2553, 0.2561, 0.2565, 0.2578, 0.2571, 0.2563, 0.2554, 0.2543, 0.2533 }, { 0.1878, 0.1939, 0.1988, 0.2027, 0.2059, 0.2085, 0.2119, 0.2131, 0.2139, 0.2145, 0.2148, 0.2151 }, { 0.1353, 0.1447, 0.1524, 0.1587, 0.1641, 0.1686, 0.1736, 0.1764, 0.1787, 0.1807, 0.1822, 0.1836 }, { 0.088, 0.1005, 0.1109, 0.1197, 0.1271, 0.1334, 0.1399, 0.1443, 0.148, 0.1512, 0.1539, 0.1563 }, { 0.0433, 0.0593, 0.0725, 0.0837, 0.0932, 0.1013, 0.1092, 0.115, 0.1201, 0.1245, 0.1283, 0.1316 }, { 0, 0.0196, 0.0359, 0.0496, 0.0612, 0.0711, 0.0804, 0.0878, 0.0941, 0.0997, 0.1046, 0.1089 }, { 0, 0, 0, 0.0163, 0.0303, 0.0422, 0.053, 0.0618, 0.0696, 0.0764, 0.0823, 0.0876 }, { 0, 0, 0, 0, 0, 0.014, 0.0263, 0.0368, 0.0459, 0.0539, 0.061, 0.0672 }, { 0, 0, 0, 0, 0, 0, 0, 0.0122, 0.0228, 0.0321, 0.0403, 0.0476 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0107, 0.02, 0.0284 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0094 } }; if (display != 0) { cout << "TABEL 1 (B) SHAPIRO WILK - COFFICIENTS \n"; cout << setfill('-') << setw(102) << "" << setfill(' ') << endl; cout << setw(8) << "-\\n= " << setw(8) << "15" << setw(8) << "16" << setw(8) << "17" << setw(8) << "18" << setw(8) << "19" << setw(8) << "20" << setw(8) << "21" << setw(8) << "22" << setw(8) << "23" << setw(8) << "24" << setw(8) << "25" << setw(8) << "26" << endl; cout << setfill('-') << setw(102) << "" << setfill(' ') << endl; for (int b = 0; b < 13; b++) { for(int k = 0; k < 12; k++) { if (k==0) { cout << left << "a" << setw(7) << b+1; cout << left << setw(8) << tabelCoffB[b][k] ; } else { //cout << tabelCoffA[b][k] << "\t"; cout << left << setw(8) << tabelCoffB[b][k] ; } } cout << endl; } cout << setfill('-') << setw(102) << "" << setfill(' ') << endl << endl << endl; } return tabelCoffB[r][c]; } float tableCofficientC(int r, int c, int display) //n=27-38, a1-a19 { float tabelCoffC[20][13] = { { 0.4366, 0.4328, 0.4291, 0.4254, 0.422, 0.4188, 0.4156, 0.4127, 0.4096, 0.4068, 0.404, 0.4015 }, { 0.3018, 0.2992, 0.2968, 0.2944, 0.2921, 0.2898, 0.2876, 0.2854, 0.2834, 0.2813, 0.2794, 0.2774 }, { 0.2522, 0.251, 0.2499, 0.2487, 0.2475, 0.2463, 0.2451, 0.2439, 0.2427, 0.2415, 0.2403, 0.2391 }, { 0.2152, 0.2151, 0.215, 0.2148, 0.2145, 0.2141, 0.2137, 0.2132, 0.2127, 0.2121, 0.2116, 0.211 }, { 0.1848, 0.1857, 0.1864, 0.187, 0.1874, 0.1878, 0.188, 0.1882, 0.1883, 0.1883, 0.1883, 0.1881 }, { 0.1584, 0.1601, 0.1616, 0.163, 0.1641, 0.1651, 0.166, 0.1667, 0.1673, 0.1678, 0.1683, 0.1686 }, { 0.1346, 0.1372, 0.1395, 0.1415, 0.1433, 0.1449, 0.1463, 0.1475, 0.1487, 0.1496, 0.1505, 0.1513 }, { 0.1128, 0.1162, 0.1192, 0.1219, 0.1243, 0.1265, 0.1284, 0.1301, 0.1317, 0.1331, 0.1344, 0.1356 }, { 0.0923, 0.0965, 0.1002, 0.1036, 0.1066, 0.1093, 0.1118, 0.114, 0.116, 0.1179, 0.1196, 0.1211 }, { 0.0728, 0.0778, 0.0822, 0.0862, 0.0899, 0.0931, 0.0961, 0.0988, 0.1013, 0.1036, 0.1056, 0.1075 }, { 0.054, 0.0598, 0.065, 0.0697, 0.0739, 0.0777, 0.0812, 0.0844, 0.0873, 0.09, 0.0924, 0.0947 }, { 0.0358, 0.0424, 0.0483, 0.0537, 0.0585, 0.0629, 0.0669, 0.0706, 0.0739, 0.077, 0.0798, 0.0824 }, { 0.0178, 0.0253, 0.032, 0.0381, 0.0435, 0.0485, 0.053, 0.0572, 0.061, 0.0645, 0.0677, 0.0706 }, { 0, 0.0084, 0.0159, 0.0227, 0.0289, 0.0344, 0.0395, 0.0441, 0.0484, 0.0523, 0.0559, 0.0592 }, { 0, 0, 0, 0.0076, 0.0144, 0.0206, 0.0262, 0.0314, 0.0361, 0.0404, 0.0444, 0.0481 }, { 0, 0, 0, 0, 0, 0.0068, 0.0131, 0.0187, 0.0239, 0.0287, 0.0331, 0.0372 }, { 0, 0, 0, 0, 0, 0, 0, 0.0062, 0.0119, 0.0172, 0.022, 0.0264 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0057, 0.011, 0.0158 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0053 } }; if (display != 0) { cout << "TABEL 1 (C) SHAPIRO WILK - COFFICIENTS \n"; cout << setfill('-') << setw(102) << "" << setfill(' ') << endl; cout << setw(8) << "-\\n= " << setw(8) << "27" << setw(8) << "28" << setw(8) << "29" << setw(8) << "30" << setw(8) << "31" << setw(8) << "32" << setw(8) << "33" << setw(8) << "34" << setw(8) << "35" << setw(8) << "36" << setw(8) << "37" << setw(8) << "38" << endl; cout << setfill('-') << setw(102) << "" << setfill(' ') << endl; for (int b = 0; b < 19; b++) { for(int k = 0; k < 12; k++) { if (k==0) { cout << left << "a" << setw(7) << b+1; cout << left << setw(8) << tabelCoffC[b][k] ; } else { //cout << tabelCoffA[b][k] << "\t"; cout << left << setw(8) << tabelCoffC[b][k] ; } } cout << endl; } cout << setfill('-') << setw(102) << "" << setfill(' ') << endl << endl << endl; } return tabelCoffC[r][c]; } float tableCofficientD(int r, int c, int display) //n=39-50, a1-a25 { float tabelCoffD[26][13] = { { 0.3989, 0.3964, 0.394, 0.3917, 0.3894, 0.3872, 0.385, 0.383, 0.3808, 0.3789, 0.377, 0.3751 }, { 0.2755, 0.2737, 0.2719, 0.2701, 0.2684, 0.2667, 0.2651, 0.2635, 0.262, 0.2604, 0.2589, 0.2574 }, { 0.238, 0.2368, 0.2357, 0.2345, 0.2334, 0.2323, 0.2313, 0.2302, 0.2291, 0.2281, 0.2271, 0.226 }, { 0.2104, 0.2098, 0.2091, 0.2085, 0.2078, 0.2072, 0.2065, 0.2058, 0.2052, 0.2045, 0.2038, 0.2032 }, { 0.188, 0.1878, 0.1876, 0.1874, 0.1871, 0.1868, 0.1865, 0.1862, 0.1859, 0.1855, 0.1851, 0.1847 }, { 0.1689, 0.1691, 0.1693, 0.1694, 0.1695, 0.1695, 0.1695, 0.1695, 0.1695, 0.1693, 0.1692, 0.1691 }, { 0.152, 0.1526, 0.1531, 0.1535, 0.1539, 0.1542, 0.1545, 0.1548, 0.155, 0.1551, 0.1553, 0.1554 }, { 0.1366, 0.1376, 0.1384, 0.1392, 0.1398, 0.1405, 0.141, 0.1415, 0.142, 0.1423, 0.1427, 0.143 }, { 0.1225, 0.1237, 0.1249, 0.1259, 0.1269, 0.1278, 0.1286, 0.1293, 0.13, 0.1306, 0.1312, 0.1317 }, { 0.1092, 0.1108, 0.1123, 0.1136, 0.1149, 0.116, 0.117, 0.118, 0.1189, 0.1197, 0.1205, 0.1212 }, { 0.0967, 0.0986, 0.1004, 0.102, 0.1035, 0.1049, 0.1062, 0.1073, 0.1085, 0.1095, 0.1105, 0.1113 }, { 0.0848, 0.087, 0.0891, 0.0909, 0.0927, 0.0943, 0.0959, 0.0972, 0.0986, 0.0998, 0.101, 0.102 }, { 0.0733, 0.0759, 0.0782, 0.0804, 0.0824, 0.0842, 0.086, 0.0876, 0.0892, 0.0906, 0.919, 0.0932 }, { 0.0622, 0.0651, 0.0677, 0.0701, 0.0724, 0.0745, 0.0765, 0.0783, 0.0801, 0.0817, 0.0832, 0.0846 }, { 0.0515, 0.0546, 0.0575, 0.0602, 0.0628, 0.0651, 0.0673, 0.0694, 0.0713, 0.0731, 0.0748, 0.0764 }, { 0.0409, 0.0444, 0.0476, 0.0506, 0.0534, 0.056, 0.0584, 0.0607, 0.0628, 0.0648, 0.0667, 0.0685 }, { 0.0305, 0.0343, 0.0379, 0.0411, 0.0442, 0.0471, 0.0497, 0.0522, 0.0546, 0.0568, 0.0588, 0.0608 }, { 0.0203, 0.0244, 0.0283, 0.0318, 0.0352, 0.0383, 0.0412, 0.0439, 0.0465, 0.0489, 0.0511, 0.0532 }, { 0.0101, 0.0146, 0.0188, 0.0227, 0.0263, 0.0296, 0.0328, 0.0357, 0.0385, 0.0411, 0.0436, 0.0459 }, { 0, 0.0049, 0.0094, 0.0136, 0.0175, 0.0211, 0.0245, 0.0277, 0.0307, 0.0335, 0.0361, 0.0386 }, { 0, 0, 0, 0.0045, 0.0087, 0.0126, 0.0163, 0.0197, 0.0229, 0.0259, 0.0288, 0.0314 }, { 0, 0, 0, 0, 0, 0.0042, 0.0081, 0.0118, 0.0153, 0.0185, 0.0215, 0.0244 }, { 0, 0, 0, 0, 0, 0, 0, 0.0039, 0.0076, 0.0111, 0.0143, 0.0174 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0037, 0.0071, 0.0104 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.035 } }; if (display != 0) { cout << "TABEL 1 (D) SHAPIRO WILK - COFFICIENTS \n"; cout << setfill('-') << setw(102) << "" << setfill(' ') << endl; cout << setw(8) << "-\\n= " << setw(8) << "39" << setw(8) << "40" << setw(8) << "41" << setw(8) << "42" << setw(8) << "43" << setw(8) << "44" << setw(8) << "45" << setw(8) << "46" << setw(8) << "47" << setw(8) << "48" << setw(8) << "49" << setw(8) << "50" << endl; cout << setfill('-') << setw(102) << "" << setfill(' ') << endl; for (int b = 0; b < 25; b++) { for(int k = 0; k < 12; k++) { if (k==0) { cout << left << "a" << setw(7) << b+1; cout << left << setw(8) << tabelCoffD[b][k] ; } else { //cout << tabelCoffA[b][k] << "\t"; cout << left << setw(8) << tabelCoffD[b][k] ; } } cout << endl; } cout << setfill('-') << setw(102) << "" << setfill(' ') << endl << endl << endl; } return tabelCoffD[r][c]; } struct dataRecord { char nama[10]; int data; }; struct dataRecordDeFloat { int nomor; float dataStc; }; int requestJmlData() { int n; while(1) { cout << "Masukkan jumlah data : "; cin >> n; cout << endl; if (n>50 || n<3) { cout << "Jumlah data harus lebih dari 2 dan kurang dari 50 !! \n"; } else { break; } } return n; } void tabelDataArr(int n, float dtColl[]) { int j = 0; while(j<n) { cout << j+1 << "\t " << dtColl[j] << "\n"; j++; } //Langkah2 uji normalitas shapiro wilk //Mereview nilai minimum dan maximum array cout << "Jumlah data : " << sizeof(dtColl) << " bytes" << endl; //sumber: https://www.w3schools.com/cpp/cpp_arrays_size.asp cout << "Jumlah data : " << sizeof(dtColl) / sizeof(int) << " elemen" << endl; //int = 4 bytes, tto get the array length } void tblBantu(int n, float tblBnt[][3]) { for (int r=0; r<n; r++) { cout << left << setw(5) << " " << setw(11) << tblBnt[r][0] << " " << setw(22) << tblBnt[r][1] << " " << setw(11) << tblBnt[r][2] << " " << endl; } } float sumSquare(int n, float sigmaXiXbPow[][3]) { float sigmaXibPow; for (int i=0; i<n; i++) { sigmaXibPow = sigmaXibPow + sigmaXiXbPow[i][2]; } return sigmaXibPow; } void headerProgram() { cout << setfill('=') << setw(42) << "" << setfill(' ') << endl; cout << left << setw(42) << "PROGRAM UJI NORMALITAS SHAPIRO-WILK" << endl << endl; cout << left << setw(42) << "Dibuat oleh : Havizul" << endl; cout << left << setw(42) << "Mata Kuliah : Pemrograman Komputer" << endl; cout << setfill('=') << setw(42) << "" << setfill(' ') << endl << endl << endl; } float getaValues(int i, int n) { float rt; switch (n) { case 0 ... 14: //Tabel 1A rt = tableCofficientA(i, n-1, 0); break; case 15 ... 26: //Tabel 1B rt = tableCofficientB(i, n-15, 0); break; case 27 ... 38: //Tabel 1C rt = tableCofficientC(i, n-27,0); break; case 39 ... 50: //Tabel 1D rt = tableCofficientD(i, n-39, 0); break; } return rt; } void tampilTblBantuNb(int n, float tblBnt[][4]) { cout << left << setw(5) << "Xi" << setw(11) << "a(i)" << setw(12) << "X(n+1-i)-Xi" << setw(16) << "a(i)*X(n+1-i)-Xi" << endl; for (int r=0; r<n; r++) { cout << left << setw(5) << tblBnt[r][0] << setw(11) << tblBnt[r][1] << setw(12) << tblBnt[r][2] << setw(16) << tblBnt[r][3]; cout << endl; } } int main() { headerProgram(); tabelSW(4,3,1); tableCofficientA(3, 2, 1); tableCofficientB(4, 7, 1); tableCofficientC(3, 9, 1); tableCofficientD(4, 7, 1); int n = requestJmlData(); //tentukan nilai alpha double alpha = 0; //cin tidak bisa membaca tipe float. while(true) { cout << "Masukkan nilai alpha (signifikansi) : "; cin >> alpha; cout << "Nilai alpha yang anda masukkan : " << alpha << endl; if (alpha == 4 || alpha == 0.01 || alpha == 0.02 || alpha == 0.05 || alpha == 0.1 || alpha == 0.5 || alpha == 0.9 || alpha == 0.95 || alpha == 0.98 || alpha == 0.99) { cout << endl; cout << "Alpha = " << alpha << endl << endl; break; } else { cout << "Nilai alpha harus 0.02, 0.05, 0.1, 0.5, 0.9, 0.95, 0.98, atau 0.99." << endl; } } //struct dataRecordDeFloat* dataArr = requestInputData(n); //sumber: https://www.digitalocean.com/community/tutorials/return-array-in-c-plus-plus-function float dataRc[n]; for (int i=0; i<n; i++) { cout << "Data Ke-" << i+1 << " : "; cin >> dataRc[i]; } printf("\nTabel Data Record\n"); printf("----------------\n"); printf("Nomor\t Nilai\n"); //untuk menata kolom lebih rapi, gunakan setw() printf("----------------\n"); //Menampilkan data tabelDataArr(n, dataRc); //Menghitung nilai maksimal dan minimal float maxVal = 0; float minVal = dataRc[0]; for (int i=0; i<(sizeof(dataRc)/sizeof(int)); i++) { if (maxVal < dataRc[i]) { maxVal = dataRc[i]; } else if (minVal > dataRc[i]) { minVal = dataRc[i]; } } cout << "\nNilai terbesar : " << maxVal << endl; cout << "Nilai terkecil : " << minVal << endl; //====================================================================== //Langkah 1: Urutkan nilai / data sort(dataRc, dataRc + (sizeof(dataRc) / sizeof(int))); //sumber: https://www.geeksforgeeks.org/sort-c-stl/ printf("\nTabel Data Record Setelah Diurutkan\n"); printf("----------------\n"); printf("Nomor\t Nilai\n"); //untuk menata kolom lebih rapi, gunakan setw() printf("----------------\n"); int j = 0; tabelDataArr(n, dataRc); //====================================================================== //Langkah 2: Hitung Jumlah Kuadrat (Sum of Squares) SS //SS = sigma(i=1, hingga n)(Xi-Xbar)^2 //Hitung Penjumlahan Seluruh Data (Sigma) float sigmaX = 0; for (int i=0; i<n; i++) { sigmaX = sigmaX + dataRc[i]; } cout << "\nSigma X = " << sigmaX << endl; float Xbar = sigmaX / n; cout << "Xbar = " << Xbar << endl; //Buat tabel bantu float tabelBantu[n][3]; cout << "\nTabel Bantu" << endl; cout << setfill('-') << setw(52) << "" << setfill(' ') << endl; cout << left << setw(5) << " " << setw(11) << "Xi" << " " << setw(22) << "Xi-Xbar" << " " << setw(11) << "(Xi-Xbar)^2" << " " << endl; //untuk menata kolom lebih rapi, gunakan setw() cout << setfill('-') << setw(52) << "" << setfill(' ') << endl; for (int r=0; r<n; r++) //baris { //tabelBantu[r][0] = dataRc[r]; for (int c=0; c<2; c++) { if (c==0) //mengisi kolom Xi { tabelBantu[r][c] = dataRc[r]; } else if (c==1) //Mengisi kolom Xi-Xbar { tabelBantu[r][c] = tabelBantu[r][0] - Xbar; tabelBantu[r][c+1] = pow(tabelBantu[r][c], 2); } } } tblBantu(n, tabelBantu); cout << setfill('-') << setw(52) << "" << setfill(' ') << endl; //SS = sigma(i=1, hingga n)(Xi-Xbar)^2 float SS = sumSquare(n, tabelBantu); cout << left << setw(5) << "Xbar" << setw(11) << Xbar << " " << setw(22) << "Sum(Xi-Xbar)^2" << " " << setw(11) << SS << " " << endl; //untuk menata kolom lebih rapi, gunakan setw() cout << setfill('-') << setw(52) << "" << setfill(' ') << endl; //====================================================================== //Langkah 3: Hitung Nilai b //b = sigma(i=1 hingga m) ai(X (n+1-i) - Xbi) //m=n/2 (jika n GENAP), m=(n+1)/2 (jika n GANJIL) //cek n ganjil atau genap, kemudian dapatkan nilai m int m; if (n%2 == 0) { m = n/2; } else { m = (n+1)/2; } cout << endl << endl; cout << "Nilai m : " << m << endl; //Ambil nilai ai dari tabel 1 shapiro wilk //tentukan nilai m float a[m+1]; for (int i=0; i<m; i++) { a[i] = getaValues(i, n); cout << "Nilai a(" << i+1 << ")" << ": " << a[i] << endl; } //tabel bantu untuk mendapatkan nilai b float tblBantuNb[n][4]; for (int i=0; i<n; i++) { tblBantuNb[i][0] = dataRc[i]; if (i >= m) { tblBantuNb[i][1] = 0; tblBantuNb[i][2] = 0; tblBantuNb[i][3] = 0; } else if (i < m) { tblBantuNb[i][1] = a[i]; tblBantuNb[i][2] = dataRc[n-(i+1)] - dataRc[i]; tblBantuNb[i][3] = a[i] * tblBantuNb[i][2]; } } cout << endl; tampilTblBantuNb(n, tblBantuNb); //hitung nilai b; float b; for (int i=0; i<m; i++) { b += tblBantuNb[i][3]; } cout << endl; cout << "Nilai b = " << b << endl << endl; cout << "Nilai n = " << n << endl << endl; //Hitung nilai W //W = b^2 / SS float Wh = pow(b, 2) / SS; cout << "Nilai Whitung : " << Wh << endl; float Wt; cout << "Nilai Wtabel : "; if (alpha == 0.01) { Wt = tabelSW(n-3, 0, 0); } else if (alpha == 0.02) { Wt = tabelSW(n-3, 1, 0); } else if (alpha == 0.05) { Wt = tabelSW(n-3, 2, 0); } else if (alpha == 0.1) { Wt = tabelSW(n-3, 3, 0); } else if (alpha == 0.5) { Wt = tabelSW(n-3, 4, 0); } else if (alpha == 0.9) { Wt = tabelSW(n-3, 5, 0); } else if (alpha == 0.95) { Wt = tabelSW(n-3, 6, 0); } else if (alpha == 0.98) { Wt = tabelSW(n-3, 7, 0); } else if (alpha == 0.99) { Wt = tabelSW(n-3, 8, 0); } else { cout << "Nilai alpha tidak memenuhi kriteria...\n" << "Nilai Wtabel tidak dapat ditampilkan." << endl << endl; } if (Wt != 0) { cout << Wt << endl << endl; } if (Wh > Wt) { cout << "Kesimpulan : " << endl; cout << "Karena Whitung > Wtabel, maka H0 diterima, dan H1 ditolak." << endl << "DATA BERDISTRIBUSI NORMAL"; } else { cout << "Kesimpulan : " << endl; cout << "Karena Whitung <= Wtabel, maka H0 ditolak, dan H1 diterima." << endl << "DATA TIDAK BERDISTRIBUSI NORMAL"; } cout << endl << endl; return 0; } |
Selasa, 24 Oktober 2023
Program Uji Normalitas Shapiro-Wilk (C++ - Code Blocks)
Sabtu, 11 Februari 2023
Speaking - God of War (Chinese Movie)
I was just delivering a pill, why are you chasing me ?
Aku baru saja mengantarkan pil, kenapa kalian mengejarku (untuk menangkap) ?
Where am I ?
Dimana saya ?
Could she have run to the Ice Palace in Sea of Immortality ?
Mungkinkah dia lari ke Istana Es di Laut Keabadian ?
Let's report to our superior first. If she did, it's a major sin.
Mari kita laporkan ke atasan kita terlebih dahulu. Jika dia melakukannya, itu adalah dosa besar.
Rabu, 18 Januari 2023
Bilangan Prima 0 Sampai 1.000.000
Masukkan angka maksimum = 1000000
Daftar bilangan prima dari 0 hingga 1000000 :
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663
Sabtu, 21 Mei 2022
20220521 (1) - Belajar Grammar, Vocabulary, & Translate (Model ASSURE)
Konten ini dibuat dalam rangka untuk pembelajaran bahasa inggris (grammar, vocabulary, dan translate) yang berisi materi-materi yang valid dan berasal dari sumber yang valid pula, sebagaimana tercantum.
Source 1: https://www.instructionaldesign.org/models/assure/
ASSURE
The ASSURE model is an ISD (Instructional Systems Design) process that was modified to be used by teachers in the regular classroom The ISD process is one in which teachers and trainers can use to design and develop the most appropriate learning environment for their students. You can use this process in writing your lesson plans and in improving teaching and learning.
Model ASSURE adalah sebuah proses DSI (Desain Sistem Instruksional) yang telah dimodifikasi untuk digunakan oleh guru di kelas reguler. Proses desain sistem instruksional adalah satu, dimana para guru dan pelatih dapat menggunakannya untuk merancang dan mengembangkan lingkungan belajar yang paling tepat untuk siswa mereka. Anda dapat menggunakan proses ini untuk menulis recana belajar yang akan dilakukan dan untuk meningkatkan pengajaran dan pembelajaran.
The ASSURE model incorporates Robert Gagne’s events of instruction to assure effective use of media in instruction.
A — Analyze learners
S — State standards & objectives
S — Select strategies, technology, media & materials
U — Utilize technology, media & materials
R — Require learner participation
E — Evaluate & revise
Model ASSURE menggabungkan teori Robert Gagne tentang 9 peristiwa dalam pembelajaran untuk memastikan penggunaan media yang efektif dalam pembelajaran.
S -- Menyatakan standar dan tujuan
S -- Memilih strategi, teknologi, media dan bahan
U -- Memanfaatkan teknologi, media dan bahan
R -- Melibatkan partisipasi peserta didik
E -- Mengevaluasi dan merevisi
Sharon Smaldino: About the Model
First, ASSURE starts with looking at the learner in detail. Nothing you plan or design is effective unless you have taken the time to look at the learners. In Illinois, for example, it is now state law that ALL teachers must assess their students’ knowledge and skills prior to instruction to ensure that they differentiate instruction. That means that by understanding where the learners are at the start of instruction, a teacher will make every effort to assist all learners to be successful in their learning endeavors. This new direction supports my position about knowing the learner. I feel that knowing as much as possible about your learners is critical to design and implementation of instruction.
Pertama, ASSURE memulainya dengan mengamati peserta didik secara rinci. Tak ada satupun pembelajaran yang anda rencanakan atau rancang akan berhasil dengan efektif, terkecuali anda telah meluangkan waktu sebelumnya untuk mengamati peserta didik. Di Illionis misalnya, saat ini telah menjadi undang-undang bahwa seluruh guru harus melakukan penilaian terhadap keterampilan dan pengetahuan siswa terlebih dahulu sebelum melaksanakan pembelajaran untuk memastikan bahwa guru membedakan pembelajaran. Itu berarti bahwa pembelajaran diawali dengan memahami dimana peserta didik berada, seorang guru akan melakukan segala upaya untuk membantu seluruh siswa agar berhasil dalam upaya keras belajar mereka. Haluan baru ini membantu posisi saya untuk mengenal peserta didik. Saya rasa bahwa mengenal sedalam mungkin terhadap peserta didik anda adalah sangat penting dalam merancang dan mengimplementasikan suatu pembelajaran.
Second, the second letter in ASSURE, S, refers to knowing the intended outcomes or expectations. No instruction should begin without everyone having a clear understanding of what is supposed to happen in the instruction. This does not preclude the possibility of additional learning taking place, but without a road map, some of your learners may well be “lost.” And, especially in the schools today, as we edge closer to the 100% of all students meeting or exceeding expectations, I believe that students need to know what is expected of them. I do believe that there is more than one “right way” to achieve those expectations and more than one “right medium” to use, because it’s not a one-size fits all world. BUT, as NCLB is still a mandate, we need to find ways to make it possible for our diverse learning population fit into the “mold” that has been outlined for us. Learners need to know what they are to do. And, I add that you cannot assess learning without knowing what was expected. NOW, because I opened that can of worms, let me quickly state that assessment can be formative and summative and can take multiple formats.
But, that is another cup of tea for sure.
Kedua, huruf yang kedua dalam ASSURE, S, merujuk pada memahami hasil atau harapan yang dikehendaki. Tidak ada pembelajaran patut untuk dimulai tanpa setiap personal yang terlibat memiliki pemahaman yang jelas terhadap apa yang dikehendaki untuk didapat dalam pembelajaran. Ini tidak menutup kemungkinan terjadinya permbelajaran tambahan, namun tanpa pedoman pelaksanaan yang jelas, beberapa peserta didik anda mungkin akan hilang. Dan, secara khusus di sekolah-sekolah saat ini, ketika kita akan mencapai angka 100% dari seluruh siswa yang memenuhi atau melebihi ekspektasi, saya yakin bahwa siswa perlu untuk mengetahui apa pencapaian yang diharapkan dari mereka. Saya sangat yakin bahwa ada lebih dari satu cara untuk mencapai ekspektasi ini dan lebih dari satu media yang dapat digunakan, karena hal tersebut bukanlah satu ukuran yang cocok untuk seluruh dunia. Akan tetapi, karena prisnip NCLB masih merupakan suatu mandat, kita perlu menemukan cara untuk membuat hal tersebut menjadi mungkin bagi populasi peserta didik kita yang beragam agar sesuai dengan kerangka yang telah diberikan pada kita. Peserta didik perlu untuk mengetahui apa yang akan mereka lakukan. Dan, saya menambahkan bahwa anda tidak akan dapat melakukan penilaian terhadap suatu pembelajaran tanpa mengetahui apa hasil yang diharapkan dari pembelajaran tersebut. Saat ini, dikarenakan saya telah membuka penutup suatu masalah kompleks, maka izinkan saya dengan segera menyatakan bahwa penilaian itu dapat berupa formatif dan sumatif, dan dapat dalam bentuk format yang beragam. Namun, Itu adalah satu hal lain yang membutuhkan secangkir teh dalam pembahasannya.
My final area of importance in the design and implementation process to ASSURE good learning is the reflection component of evaluation. Once you have completed the design and instruction and gathered the data about the outcomes and impressions from your learners, you need to take the time to consider what went well and what could be changed in that particular instructional event. This information will help you re-design that instructional event for future opportunities. But, this information also guides you on how to better address your learners in instruction beyond this particular instructional event. We often do not put enough emphasis on reflection as teachers and designers, but I do consider that it is not time wasted.
Oh, my goodness, it appears I’ve nearly written the chapter on the ASSURE model. I will close with the idea that it’s not about the technology and media. It’s about the learners and the important decisions we make as designers and
instructors to ensure successful learning opportunities.”
[From Michael M. Grant‘s Comparing Instructional Design Models]
____________________________________________________________________________
Source 2: https://elearningindustry.com/6-tips-apply-assure-model-blended-learning
6 Tips To Apply The ASSURE Model In Blended Learning
How To Apply The ASSURE Model In Blended Learning: 6 Tips For eLearning Professionals
While many blended learning approaches may strive to incorporate technology into the ILT environment, at PulseLearning we believe the ASSURE model takes it one step further by catering on the specific needs of the every learner. Rather than offering general tech tools or resources, it focuses on giving each learner the specific technology they require to achieve their personal goals and objectives.
What Is The ASSURE Model?
The ASSURE model gets its name from the following six stages involved in the process:
- A: Analyze learners.
Identify your learners’ expectations, goals, preferences, and needs, so that you can create a blended learning strategy that offers them real world benefits. - S: State goals and objectives.
Determine the objectives for your blended learning course, including performance goals. These goals and objectives should clearly state what the learner will be able to do once they complete the class. - S: Select methods and media.
Choose online learning content, multimedia, both online and classroom exercises and materials that will serve your training goals and objectives. This may also pertain to modifying current training content in order to meet the changing needs of your audience. - U: Utilize media and technology.
After choosing the online training content and materials, eLearning professionals must then decide how they are going to utilize these tech tools and online resources most effectively. - R: Require learner participation.
Determine how you can engage learners to encourage them to actively participate in the blended training experience. - E: Evaluate and revise the blended learning strategy.
All eLearning strategies are a work in progress, due to the fact that technology and learner needs are always evolving. Thus, the final step in the ASSURE model is to evaluate and revise your blended learning strategy to ensure that it is as beneficial as possible.
6 Tips To Use The ASSURE Model In Blended Learning
- Conduct surveys and online assessments to research audience.
To focus on the specific needs of your learners, you will first have to know what those needs are. Surveys, focus groups, interviews, and eLearning assessments are all valuable tools that can help you analyze your audience’s traits and experience levels. They can also give you a good indication of their learning styles, such as which exercises will appeal to them and how they absorb information. - Create custom-tailored objectives.
Aside from the organization-wide objectives and goals that you’ve created, you should also develop goals that are learner-specific. What learning behaviors do they need to display? What knowledge do they need to know by the end of the blended learning course? Is there a particular task they need to master or skills sets they must build? You must also have a way to test their knowledge and determine if they have actually met their goals and objectives. - Choose tech tools that align with common goals.
One of the most common blended learning strategy mistakes is using technology just for the sake of technology, rather than finding the tools that are ideal for the particular audience and training goals. Ideally, you should choose tools that your learners are already familiar with or have a minor learning curve, rather than those that may be difficult to master. For example, if you are developing a group collaboration online assignment that utilizes a project management platform, you must be sure that your learners can actually use the online platform when it’s time to work with their peers. - Give the tech tools and materials a test-run.
To verify that all of your tech tools are in working order and that your learners can use them effectively, it’s always a good idea to give your technology a test-run before you offer them to your learners. For example, if you are using tablets in the classroom, you should ensure that all of the devices are working properly, fully charged, and loaded with the right applications. If you are using an online tool, verify that your learners have all the information they need to access the online platform and that there aren’t any issues with logging into the site. - Get learners involved.
As is the case with all learning strategies, it is important to get your learners onboard and make sure they are all excited about the process. Start your discussions with thought-provoking questions that prompt them to seek out answers online and expand their knowledge. Create an online community forum where they can go to address concerns, get help from their peers, and stay in touch with their online facilitators. Ask for their feedback so that you can figure out what’s working effectively and what may need to be modified as you move forward with your ASSURE blended learning strategy. Get them involved, so that they feel as though they are a vital part of the blended learning experience and that their opinion matters. - Understand that your ASSURE strategy is a work in progress.
After you’ve created your ASSURE plan, you must keep in mind that it has to adapt with the changing needs of your learners. It must also adapt to the ever-evolving technologies, so that you can offer your future learners the best resources you have at your disposal. If there is a learning activity that is no longer serving the needs or goals of your learners, they you may want to consider modifying or omitting it from your training curriculum altogether. The same goes for your eLearning assessments, online training content, or even the level of tech integration. For instance, you may discover that your learners might benefit from even more tech tool usage.
The ASSURE model can help you not only blend technology with traditional classroom training, but give your learners the customized experience they need to broaden their horizons. Use this article to integrate technology tools and resources into your blended learning strategy while still catering to the specific needs of your corporate audience.