fork(1) download
  1. PROGRAM Tukang_Jualan_Tiket_Bioskop;
  2.  
  3. TYPE kelas
  4. <
  5. Price:integer;
  6. >
  7.  
  8. TYPE tiketfilm
  9. <
  10. tipe : kelas;
  11. all : integer;
  12. title:string;
  13. >
  14. KAMUS
  15. r:integer;
  16. x:integer;
  17. pilih:integer;
  18. Skyfall : tiketfilm;
  19.  
  20. PROCEDURE Tampilkan(I/O tiketfilm f)
  21. /*I.S. = Tipe tiket film */
  22. /*F.S .=Menampilkan status tiket film*/
  23.  
  24. FUNCTION updateprice(tiketfilm v) →integer
  25. /* I.S. = Harga awal tiket film */
  26. /* F.S. = Pengubahan Harga tiket film oleh user */
  27. FUNCTION addticket(tiketfilm s) →integer
  28. /* I.S.= Jumlah tiket awal */
  29. /* F.S. = Jumlah tiket ditambahkan oleh user */
  30.  
  31. ALGORITMA //untuk program utama
  32. {
  33. output("\n 1. Masukkan Data Film");
  34. output("\n 2. Tambah Tiket");
  35. output("\n 3. Ganti Harga Tiket");
  36. output("\n 4. Lihat Data Tiket");
  37. output("\n 5. Exit");
  38.  
  39. output("\n Masukkan pilihan anda :");
  40. input(pilih);
  41. while(pilih<>5) DO
  42. BEGIN
  43. IF(pilih==1)
  44. THEN{
  45. output("\n Masukkan Harga tiket :");
  46. input(Skyfall.tipe.price);
  47. output("\n Masukkan Jumlah tiket :");
  48. input(Skyfall.all);
  49. output("\n Masukkan Judul film :");
  50. input(Skyfall.title);
  51.  
  52. output("\n done!");
  53. output("\n 1. Masukkan Data Film");
  54. output("\n 2. Tambah Tiket");
  55. output("\n 3. Ganti Harga Tiket");
  56. output("\n 4. Lihat Data Tiket");
  57. output("\n 5. Exit");
  58. output("\n Masukkan pilihan anda :");
  59. input(pilih);
  60. }
  61. ELSE
  62. IF(pilih==2) THEN
  63. begin
  64. x←addticket(Skyfall);
  65. output("Sekarang Jumlah tiketnya menjadi ",x);
  66. output("\n done!");
  67. output("\n 1. Masukkan Data Film");
  68. output("\n 2. Tambah Tiket");
  69. output("\n 3. Ganti Harga Tiket");
  70. output("\n 4. Lihat Data Tiket");
  71. output("\n 5. Exit");
  72. output("\n Masukkan pilihan anda :");
  73. input(pilih);
  74. end
  75. ELSE
  76. IF(pilih==3)THEN
  77. begin
  78. r←updateprice(Skyfall);
  79. output("Sekarang Harga Tiketnya menjadi ",r);
  80. output("\n done!");
  81. output("\n 1. Masukkan Data Film");
  82. output("\n 2. Tambah Tiket");
  83. output("\n 3. Ganti Harga Tiket");
  84. output("\n 4. Lihat Data Tiket");
  85. output("\n 5. Exit");
  86. output("\n Masukkan pilihan anda :");
  87. input(pilih);
  88. end
  89. ELSE
  90. IF(pilih==4) THEN
  91. begin
  92. Tampilkan(Skyfall);
  93. output("\n 1. Masukkan Data Film");
  94. output("\n 2. Tambah Tiket");
  95. output("\n 3. Ganti Harga Tiket");
  96. output("\n 4. Lihat Data Tiket");
  97. output("\n 5. Exit");
  98. output("\n Masukkan pilihan anda :");
  99. input(pilih);
  100. end
  101. END
  102. FUNCTION updateprice(tiketfilm v) →integer
  103. /* I.S. = Harga awal tiket film*/
  104. /* F.S. = Pengubahan Harga tiket film oleh user */
  105. KAMUS
  106. a:integer;
  107. ALGORITMA
  108. a←v.tipe.price;
  109. output("Masukkan harga yang baru:");
  110. input(v.tipe.price);
  111. → v.tipe.price;
  112.  
  113. FUNCTION addticket(tiketfilm s) →integer
  114. /* I.S.= Jumlah tiket awal */
  115. /* F.S. = Jumlah tiket ditambahkan oleh user */
  116. KAMUS
  117. n:integer;
  118. a:integer;
  119. ALGORITMA
  120. begin
  121. n←s.all;
  122. output("Masukkan jumlah tiket tambahan:");
  123. input(a);
  124. s.all←s.all+a;
  125. →s.all;
  126. end
  127. PROCEDURE Tampilkan (I/O tiketfilm f)
  128. /*I.S. = Tipe tiket film */
  129. /*F.S .=Menampilkan status tiket film*/
  130. KAMUS
  131. f:tiketfilm;
  132. ALGORITMA
  133. begin
  134. Output(“Judul Film adalah “,f.title);
  135. Output(“Harga Tiap tiketnya sebesar“,f.tipe.price);
  136. Output(“Jumlah tiket yang tersedia sebanyak “,f.all);
  137. end
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Tukang_Jualan_Tiket_Bioskop’
prog.c:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kelas’
prog.c:6: error: expected identifier or ‘(’ before ‘>’ token
prog.c:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:13: error: expected identifier or ‘(’ before ‘>’ token
prog.c:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Tampilkan’
prog.c:24: error: stray ‘\342’ in program
prog.c:24: error: stray ‘\206’ in program
prog.c:24: error: stray ‘\222’ in program
prog.c:27: error: stray ‘\342’ in program
prog.c:27: error: stray ‘\206’ in program
prog.c:27: error: stray ‘\222’ in program
prog.c:64: error: stray ‘\342’ in program
prog.c:64: error: stray ‘\206’ in program
prog.c:64: error: stray ‘\220’ in program
prog.c:78: error: stray ‘\342’ in program
prog.c:78: error: stray ‘\206’ in program
prog.c:78: error: stray ‘\220’ in program
prog.c:102: error: stray ‘\342’ in program
prog.c:102: error: stray ‘\206’ in program
prog.c:102: error: stray ‘\222’ in program
prog.c:108: error: stray ‘\342’ in program
prog.c:108: error: stray ‘\206’ in program
prog.c:108: error: stray ‘\220’ in program
prog.c:111: error: stray ‘\342’ in program
prog.c:111: error: stray ‘\206’ in program
prog.c:111: error: stray ‘\222’ in program
prog.c:113: error: stray ‘\342’ in program
prog.c:113: error: stray ‘\206’ in program
prog.c:113: error: stray ‘\222’ in program
prog.c:121: error: stray ‘\342’ in program
prog.c:121: error: stray ‘\206’ in program
prog.c:121: error: stray ‘\220’ in program
prog.c:124: error: stray ‘\342’ in program
prog.c:124: error: stray ‘\206’ in program
prog.c:124: error: stray ‘\220’ in program
prog.c:125: error: stray ‘\342’ in program
prog.c:125: error: stray ‘\206’ in program
prog.c:125: error: stray ‘\222’ in program
prog.c:134: error: stray ‘\342’ in program
prog.c:134: error: stray ‘\200’ in program
prog.c:134: error: stray ‘\234’ in program
prog.c:134: error: stray ‘\342’ in program
prog.c:134: error: stray ‘\200’ in program
prog.c:134: error: stray ‘\234’ in program
prog.c:135: error: stray ‘\342’ in program
prog.c:135: error: stray ‘\200’ in program
prog.c:135: error: stray ‘\234’ in program
prog.c:135: error: stray ‘\342’ in program
prog.c:135: error: stray ‘\200’ in program
prog.c:135: error: stray ‘\234’ in program
prog.c:136: error: stray ‘\342’ in program
prog.c:136: error: stray ‘\200’ in program
prog.c:136: error: stray ‘\234’ in program
prog.c:136: error: stray ‘\342’ in program
prog.c:136: error: stray ‘\200’ in program
prog.c:136: error: stray ‘\234’ in program
stdout

Standard output is empty