Advertisement
Guest User

Program Laundry c3budiman

a guest
Nov 6th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 18.00 KB | None | 0 0
  1.        IDENTIFICATION DIVISION.
  2.        PROGRAM-ID. TugasMenuDanTabel.
  3.            AUTHOR. Cecep Budiman.
  4.            INSTALLATION. Kosan Cecep.
  5.        
  6.        environment division.
  7.        configuration section.
  8.        SPECIAL-NAMES.
  9.            DECIMAL-POINT IS COMMA
  10.  
  11.        DATA DIVISION.
  12.        FILE SECTION.
  13.        WORKING-STORAGE SECTION.
  14.        01 perlaundryan.
  15.             02 paket pic x(12) occurs 10 times.
  16.             02 parfum pic x(12) occurs 10 times.
  17.             02 nama pic x(12) occurs 10 times.
  18.             02 kg pic 9(2) occurs 10 times.
  19.             02 jumlahorg pic 99.
  20.             02 hargaperkg pic 9(5).
  21.             02 hargatotal pic 9(9).
  22.             02 totalharga pic 9(9).
  23.             02 kgtot pic 9(2)
  24.        01 satuan.
  25.           02 kgb pic 9.
  26.           02 jumlahb pic s99999.
  27.           02 jumlah2b pic s99999.
  28.           02 uangb pic s99999.
  29.           02 kembalianb pic s99999.
  30.           02 feesb pic s9999.
  31.           02 namab pic x(14).
  32.  
  33.        01 TANYA PIC A VALUE SPACE.
  34.            88 YA VALUE "Y" "y".
  35.            88 TIDAK VALUE "T" "t".
  36.  
  37.             77 pil pic 9.
  38.             77 i pic 9.
  39.             77 BERHENTI PIC A.
  40.             77 garis PIC X(77) VALUE ALL '-'.
  41.             77 paketkg pic x(12).
  42.             77 pck pic x(12).
  43.             77 kgnya pic x(2) value "kg".
  44.             77 kgtiga pic x(2).
  45.             77 tot pic ZZZ.ZZZ.ZZZ.
  46.             77 baju pic zz.
  47.  
  48.        01 judul-1 PIC X(25) VALUE ' Tabel Daftar Pelanggan  '.
  49.        01 judul-2.
  50.            02 FILLER  PIC X(2) VALUE '| '.
  51.            02 FILL PIC X(15) VALUE 'Nama Pelanggan '.
  52.            02 FILL PIC X(2) VALUE '| '.
  53.            02 FILL PIC X(17) VALUE 'Paket yg dipilih '.
  54.            02 FILL PIC X(1) VALUE '| '.
  55.            02 FILL PIC X(7) VALUE ' KG '.
  56.            02 FILL PIC X(1) VALUE '| '.
  57.            02 FILL PIC X(17) VALUE ' Tambahan Parfum '.
  58.            02 FILL PIC X(1) VALUE '| '.
  59.            02 FILL PIC X(13) VALUE ' Total Harga '.
  60.            02 FILL PIC X(1) VALUE '| '.
  61.            
  62.        01 isi-tabel.
  63.            02 FILL PIC X(2) VALUE '| '.
  64.            02 namadua PIC x(15).
  65.            02 FILL PIC X(2) VALUE '| '.
  66.            02 paketdua PIC x(17).
  67.            02 FILL PIC X(2) VALUE '| '.
  68.            02 kgdua PIC x(6).
  69.            02 FILL PIC X(2) VALUE '| '.
  70.            02 parfumdua PIC x(16).
  71.            02 FILL PIC X(2) VALUE '| '.
  72.            02 hargadua PIC ZZZ.ZZZ.ZZZB.
  73.            02 FILL PIC X(2) VALUE '| '.
  74.          
  75.        SCREEN SECTION.
  76.        01 menu.
  77.             02 line 1 column 10 value
  78.             "           ______________________________________".
  79.             02 line 2 column 10 value
  80.             "  ________|                                      |____".
  81.             02 line 3 column 10 value
  82.             "  ________|                                      |_______".
  83.             02 line 4 column 10 value
  84.             "  \      |                                      |      /".
  85.             02 line 5 column 10 value
  86.             "   \     |                                      |     /".
  87.             02 line 6 column 10 value
  88.             "   /      |______________________________________|     \".
  89.            02 line 7 column 10 value
  90.            "  /__________)                                (_________\".
  91.           02 line 4 column 27 value "<< Menu Program Laundry >>",
  92.           background-color 5, highlight.
  93.           02 line 10 column 9 value
  94.           "[1]. Pelanggan satuan (Paket Reguler)",
  95.           highlight, foreground-color 3.
  96.           02 line 12 column 9 value
  97.           "[2]. Pelanggan Banyak / Daftar Pelanggan",
  98.           highlight, foreground-color 3.
  99.           02 line 14 column 9 value "[3]. Keluar",
  100.           highlight, foreground-color 3.
  101.           02 line plus 3 column 9 "masukkan pilihan : ".
  102.  
  103.       01 muka.
  104.           02 line 4 COLUMN 5 value
  105.           "WW      WW        lll                                 ",
  106.           highlight, foreground-color 2.
  107.           02 line 5 column 5 value
  108.           "WW      WW   eee  lll   cccc  oooo  mm mm mmmm    eee ",
  109.           highlight, foreground-color 2.
  110.           02 line 6 column 5 value
  111.           "WW   W  WW ee   e lll cc     oo  oo mmm  mm  mm ee   e",
  112.           highlight, foreground-color 2.
  113.           02 line 7 column 5 value
  114.           " WW WWW WW eeeee  lll cc     oo  oo mmm  mm  mm eeeee ",
  115.           highlight, foreground-color 2.
  116.           02 line 8 column 5 value
  117.           "  WW   WW   eeeee lll  ccccc  oooo  mmm  mm  mm  eeeee",
  118.           highlight, foreground-color 2.
  119.  
  120.           02 line 20 COLUMN 1
  121.           value "tekan Enter Untuk Melanjutkan.................".
  122.  
  123.       01 transaksiawal1.
  124.          02 line 3 column 50 value
  125.          "===========================" highlight,foreground-color 2.
  126.          02 line 4 column 50 value
  127.          "Masuk : " highlight, foreground-color 4.
  128.       01 transaksiawal2.
  129.          02 line 3 column 50 value
  130.          "===========================" highlight, foreground-color 2.
  131.          02 line 4 column 50 value
  132.          "Masuk Sebagai : " highlight, foreground-color 4.
  133.       01 transaksiawal1.
  134.          02 line 3 column 50 value
  135.          "===========================" highlight,foreground-color 2.
  136.          02 line 4 column 50 value
  137.          "Masuk : " highlight, foreground-color 4.
  138.       01 transaksiawal2.
  139.          02 line 3 column 50 value
  140.          "===========================" highlight, foreground-color 2.
  141.          02 line 4 column 50 value
  142.          "Masuk Sebagai : " highlight, foreground-color 4.
  143.       01 transaksiawal3.
  144.           02 line 3 column 3 value
  145.           "=============================" highlight, foreground-color 2.
  146.           02 line 4 column 3 value
  147.           "Harga Per Kg : RP. 6000" highlight, foreground-color 6.
  148.           02 line 5 column 3 value
  149.           "=============================" highlight, foreground-color 2.
  150.           02 line 6 column 3 value
  151.           "PPN = 10% " highlight, foreground-color 6.
  152.           02 line 7 column 3 value
  153.           "=============================" highlight, foreground-color 2.
  154.           02 line 8 column 3 value
  155.          "Laundry Berapa KG? " highlight, foreground-color 4.
  156.       01 transaksilanjut1.
  157.           02 line 9 column 3 value
  158.           "=============================" highlight, foreground-color 2.
  159.           02 line 10 column 3 value
  160.           "Harga Sebelum Pajak : " highlight.
  161.       01 transaksilanjut2.
  162.           02 line 12 column 3 value
  163.           "Pajak : " highlight.
  164.       01 transaksilanjut3.
  165.           02 line 14 column 3 value
  166.           "Total Bayar : " highlight.
  167.       01 transaksilanjut4.
  168.           02 line 15 column 3 value
  169.           "==========================================================="
  170.           highlight, foreground-color 2.
  171.           02 line 16 column 3 value
  172.           "Uang yg dibayarkan : " highlight, foreground-color 4.
  173.       01 transaksilanjut5.
  174.           02 line 17 column 3 value
  175.           "Kembalian Anda : " highlight.
  176.       01 terakhir.
  177.           02 line 18 column 3 value
  178.           "==========================================================="
  179.           highlight, foreground-color 2.
  180.           02 line 19 column 3 value
  181.           "Terima Kasih, Laundry Beres Dalam 2 Hari. " highlight.
  182.       01 tampilanauthor.
  183.            02 line 4 column 4 value "Pembuat : Cecep Budiman",
  184.            highlight, foreground-color 3.
  185.            02 line 6 column 4 value "Tanggal Pembuatan : 04-11-2016",
  186.            highlight, foreground-color 3.
  187.            02 line 8 column 4 value "Instalasi : Notbudiman-pc",
  188.            highlight, foreground-color 3.
  189.            02 line 10 column 4
  190.            value "Tempat Pembuatan : Depok, Indonesia",
  191.            highlight, foreground-color 3.
  192.            02 line 4 column 50 value "⊂_ヽ            ",
  193.            highlight, foreground-color 3.
  194.            02 line 5 column 50 value "  \\ __      ",
  195.            highlight, foreground-color 3.
  196.            02 line 6 column 50 value "   \( •_•)   ",
  197.            highlight, foreground-color 3.
  198.            02 line 7 column 50 value "    < ⌒ヽ    ",
  199.            highlight, foreground-color 3.
  200.            02 line 8 column 50 value "   /   へ\   ",
  201.            highlight, foreground-color 3.
  202.            02 line 9 column 50 value "   /  / \\ ",
  203.            highlight, foreground-color 3.
  204.            02 line 10 column 50 value "   レ ノ   ヽ_つ ",
  205.            highlight, foreground-color 3.
  206.            02 line 11 column 50 value "  / /    ",
  207.            highlight, foreground-color 3.
  208.            02 line 12 column 50 value "  / /     ",
  209.            highlight, foreground-color 3.
  210.            02 line 13 column 50 value " ( (ヽ    ",
  211.            highlight, foreground-color 3.
  212.            02 line 14 column 50 value " | |、\  ",
  213.            highlight, foreground-color 3.
  214.            02 line 15 column 50 value " | 丿 \ ⌒)",
  215.            highlight, foreground-color 3.
  216.            02 line 16 column 50 value " | |  ) /",
  217.            highlight, foreground-color 3.
  218.            02 line 17 column 50 value ")  Lノ__",
  219.            highlight, foreground-color 3.
  220.            02 line 18 column 50 value "(/___",
  221.            highlight, foreground-color 3.
  222.            02 line 20 COLUMN 1
  223.            value "tekan Enter Untuk Melanjutkan.................".
  224.       01 BERSIHKAN-LAYAR.
  225.           02 BLANK SCREEN.
  226.       01 paket-laundry.
  227.           02 line 4 column 5 value " >> Pilih paket laundry : << ",
  228.           underline, background-color 4.
  229.           02 line 5 column 5 value " 1. Reguler 2 Hari (Rp 6000 / kg)".
  230.           02 line 6 column 5 value " 2. Hemat 3 Hari (Rp 5000 / Kg)".
  231.           02 line 7 column 5 value " 3. Express 1 Hari (Rp 7000 / kg)".
  232.           02 line 8 column 5 value " 4. Zeus 1/2 Hari (Rp 10000 / kg)".
  233.           02 line 10 column 5 value "".
  234.  
  235.       01 parfumdisplay.
  236.           02 line 4 column 5 value " >> Parfum yang diinginkan? << ",
  237.           underline, background-color 4.
  238.           02 line 5 column 5 value "1. Aroma Stroberi".
  239.           02 line 6 column 5 value "2. Aroma Lavender".
  240.           02 line 7 column 5 value "3. Aroma Jeruk".
  241.           02 line 8 column 5 value "4. Aroma Biskuit Kelapa".
  242.           02 line 9 column 5 value "5. Aroma Mantan".
  243.           02 line 10 column 5 value "6. tanpa parfum".
  244.           02 line 12 column 5 value "".
  245.  
  246.       01 jasjus.
  247.          02 line 11 column 5 value "".
  248.       01 jasjus2.
  249.          02 line 13 column 5 value "".
  250.       01 jasjus3.
  251.          02 line 4 column 5 value "Siapa nama pelanggan ke ".
  252.       01 jasjus4.
  253.          02 line 5 column 5 value ""
  254.       01 jasjus5.
  255.          02 line 4 column 5 value "".
  256.       01 jasjus6.
  257.          02 line 4 column 5 value
  258.          "  >Berapa Banyak Orang yang ngelaundry hari ini ?<  ",
  259.          highlight, foreground-color 2, background-color 4.
  260.      01 akhir.
  261.          02 line 1 column 3 value
  262.          "                                                        |\",
  263.          highlight, foreground-color 2.
  264.          02 line 2 column 3 value
  265.          "                    ))))                                | \",
  266.          highlight, foreground-color 2.
  267.          02 line 3 column 3 value
  268.          "                    ( oo                                |",
  269.          highlight, foreground-color 2.
  270.          02 line 4 column 3 value
  271.          "              _______\-/__    ____(////___              |",
  272.          highlight, foreground-color 2.
  273.          02 line 5 column 3 value
  274.          "             / O * // \\g\ / O //oo )ag \             |",
  275.          highlight, foreground-color 2.
  276.          02 line 6 column 3 value
  277.          "             |______\\\|\\|  |___\\\-/____|             |",
  278.          highlight, foreground-color 2.
  279.          02 line 7 column 3 value
  280.          "            | _____(_)(_)_ ||     \  \\    |            |",
  281.          highlight, foreground-color 2.
  282.          02 line 8 column 3 value
  283.          "            ||            |||      | //    |            |",
  284.          highlight, foreground-color 2.
  285.          02 line 9 column 3 value
  286.          "            ||           ]|||      |_\)    |            |",
  287.          highlight, foreground-color 2.
  288.          02 line 10 column 3 value
  289.          "   /\  ____ ||            |||      /||     |  _______   |",
  290.          highlight, foreground-color 2.
  291.          02 line 11 column 3 value
  292.          " [|  ||Tide|||____________|||      \||     |  |#####|   |",
  293.          highlight, foreground-color 2.
  294.          02 line 12 column 3 value
  295.          "__|__||____||______________||______((_)____|__|#####|___|",
  296.          highlight, foreground-color 2.
  297.          02 line 13 column 3 value
  298.          "                                              |#####| c3b\",
  299.          highlight, foreground-color 2.
  300.          02 line 15 column 3 value
  301.          "Apakah anda yakin ingin keluar? y/t ",
  302.          highlight, foreground-color 2.
  303.  
  304.       01 hapus-layar.
  305.           02 blank screen.
  306.  
  307.       PROCEDURE DIVISION.
  308.       tampilanmuka.
  309.           display hapus-layar.
  310.           DISPLAY muka.
  311.           accept berhenti.
  312.       authorza.
  313.           display hapus-layar.
  314.           display tampilanauthor.
  315.           accept berhenti.
  316.       menunya.
  317.           display hapus-layar.
  318.           display menu.
  319.           accept pil.
  320.           go to satuannya, mulai, selesai2 depending on pil.
  321.       mulai.
  322.            display hapus-layar.
  323.            display jasjus6.
  324.            display jasjus4.
  325.            ACCEPT jumlahorg.
  326.                IF jumlahorg > 9
  327.                   DISPLAY "ga bisa kebanyakan"
  328.                   GO TO mulai.
  329.                IF jumlahorg = 0
  330.                   DISPLAY "masa ga ada pelanggan -_-"
  331.                    GO TO mulai.
  332.            display BERSIHKAN-LAYAR.
  333.            perform varying i from 1 by 1 until i > jumlahorg
  334.            display jasjus3
  335.            display , i ," ?"
  336.            display jasjus4
  337.            accept nama(i)
  338.            display bersihkan-layar
  339.            display jasjus5
  340.            display "Berapa kg pelanggan ke ", i," nge laundry?"
  341.            display jasjus4
  342.            accept kg(i)
  343.            display BERSIHKAN-LAYAR
  344.            display paket-laundry
  345.            display "masukkan pilihan pelanggan ke ", i,":"
  346.            display jasjus
  347.            accept paket(i)
  348.            display BERSIHKAN-LAYAR
  349.            display parfumdisplay
  350.            display "Pelanggan ke ", i," mau pake parfum apa?"
  351.            display jasjus2
  352.            accept parfum(i)
  353.            display BERSIHKAN-LAYAR.
  354.          
  355.       judultabel.
  356.           DISPLAY BERSIHKAN-LAYAR.
  357.           DISPLAY judul-1.
  358.           DISPLAY garis.
  359.           DISPLAY judul-2.
  360.           display garis.
  361.  
  362.       proses.
  363.           PERFORM tampilkan-isi-tabel
  364.               VARYING i FROM 1 BY 1 UNTIL i > jumlahorg.
  365.       selesai.
  366.            display garis.
  367.            move totalharga to tot.
  368.            move kgtot to baju.
  369.            display space.
  370.            display space.
  371.            display "total pendapatan laundry hari ini :", tot,
  372.            " Rupiah".
  373.            display "total baju kotor yang harus kita laundry : ", baju,
  374.            " kg ".
  375.            accept berhenti.
  376.            display hapus-layar.
  377.            compute kgtot = 0.
  378.            compute totalharga = 0.
  379.       selesai2.
  380.            display hapus-layar.
  381.            display akhir.
  382.            display space.
  383.            accept tanya.
  384.            if TIDAK go to tampilanmuka.
  385.            stop run.
  386.  
  387.       satuannya.
  388.           display hapus-layar.
  389.           display transaksiawal1.
  390.           accept namab.
  391.           display hapus-layar.
  392.           display transaksiawal2.
  393.           display namab.
  394.           display transaksiawal3.
  395.           accept kgb.
  396.           display transaksilanjut1.        
  397.           compute jumlahb = (kgb * 6000).
  398.           display kgb " * 6000 = Rp. " jumlahb.
  399.           compute feesb = (kgb * 6000 * 0,1).
  400.           display transaksilanjut2.
  401.           display "Rp. " feesb.
  402.           compute jumlah2b = jumlahb + feesb.
  403.           display transaksilanjut3.
  404.           display jumlahb " + " feesb " = RP. " jumlah2b.
  405.           display transaksilanjut4.
  406.           accept uangb.
  407.           compute kembalianb = uangb - jumlah2b.
  408.           display transaksilanjut5.
  409.           display "Rp. " kembalianb.
  410.           display terakhir.
  411.           accept berhenti.
  412.           go to selesai2.
  413.  
  414.       tampilkan-isi-tabel.
  415.            move nama(i) to namadua.
  416.            if paket(i) = 1 move 6000 to hargaperkg.
  417.            if paket(i) = 2 move 5000 to hargaperkg.
  418.            if paket(i) = 3 move 7000 to hargaperkg.
  419.            if paket(i) = 4 move 10000 to hargaperkg.
  420.            compute hargatotal = hargaperkg * kg(i).
  421.            compute totalharga = hargatotal + totalharga.
  422.            move hargatotal to hargadua.
  423.            move kg(i) to kgtiga.
  424.            compute kgtot = kgtot + kg(i).
  425.  
  426.            STRING
  427.               kgtiga DELIMITED BY SPACE
  428.               ' '   DELIMITED BY SIZE
  429.               kgnya DELIMITED BY SPACE
  430.               ' '   DELIMITED BY SIZE
  431.            INTO kgdua
  432.            END-STRING
  433.  
  434.            if paket(i) = 1 move "Reguler" to paket(i).
  435.            if paket(i) = 2 move "Hemat" to paket(i).
  436.            if paket(i) = 3 move "Express" to paket(i).
  437.            if paket(i) = 4 move "Zeus" to paket(i).
  438.            move paket(i) to paketdua.
  439.  
  440.            if parfum(i) = 1 move "Stroberi" to parfum(i).
  441.            if parfum(i) = 2 move "Lavender" to parfum(i).
  442.            if parfum(i) = 3 move "Jeruk" to parfum(i).
  443.            if parfum(i) = 4 move "Bkt Kelapa" to parfum(i).
  444.            if parfum(i) = 5 move "Mantan" to parfum(i).
  445.            if parfum(i) = 6 move "No Parfum" to parfum(i).
  446.            move parfum(i) to parfumdua.
  447.            
  448.            DISPLAY isi-tabel.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement