fork download
  1. PROGRAM Manajemen_Buku;
  2. TYPE Buku <
  3. judul :string;
  4. pengarang:string;
  5. TahunTerbit:string;
  6. Total:integer; /*Total Buku yang ada di Perpustakaan */
  7. Jumlah:integer; /*Jumlah buku yang tidak dipinjam */
  8. Pinjam:integer;
  9. >
  10. Kamus
  11. PROCEDURE PinjamBuku(Input /Output b: Buku )
  12. /*I.S. <-- Mengakses buku dari perpustakaan */
  13. /*F.S. <-- Meminjam buku dan mengurangi jumlah ketersediaannya */
  14. PROCEDURE KembalikanBuku(Input/Output c : Buku )
  15. /* I.S. <-- Mengakses buku yang akan dikembalikan */
  16. /* F.S. <-- Mengembalikan buku dan menambah jumlah ketersediaannya*/
  17. PROCEDURE InputData(IN/OUT Buku d)
  18. /*I.S. <-- Menentukan tipe data tujuan */
  19. /*F.S. <-- Memasukkan isi data ke dalam ADT Tujuan */
  20.  
  21. PROCEDURE TampilkanData(IN/OUT Buku d)
  22. /*I.S. <-- Mendapatkan data Buku */
  23. /*F.S. <-- Menampilkan data Buku */
  24. Fiksi : Buku;
  25. x,y,z: :integer;
  26. pilih :char;
  27. ALGORITMA
  28. output(“Selamat datang di Program Manajemen Buku Perpustakaan”);
  29. output(1. Input data Buku”);
  30. output(2. Pinjam Buku “);
  31. output(3. Kembalikan Buku”);
  32. output(4. Tampilkan Data”);
  33. output(5. Exit);
  34. output(“Masukkan pilihan anda :);
  35. input (pilih);
  36. while pilih <>5do
  37. begin
  38. depend on (pilih) :
  39. 1: begin
  40. InputData(Fiksi);
  41. end
  42. 2: begin
  43. PinjamBuku(Fiksi);
  44. End
  45. 3: begin
  46. KembalikanBuku(Fiksi);
  47. End
  48. 4: begin
  49. TampilkanData(Fiksi);
  50. End
  51. 5: begin
  52. Output(“Terimakasih”);
  53. end
  54. end
  55. END
  56. PROCEDURE PinjamBuku(Input /Output b: Buku )
  57. Kamus
  58. x : integer;
  59. Algoritma
  60. Begin
  61. Output(“masukkan jumlah buku yang akan anda pinjam :);
  62. Input(x);
  63. If (b.Jumlah <-- 0) then
  64. Output(“Maaf buku yang anda input, sedang kosong”);
  65. Else
  66. b.Jumlah <-- b.Jumlah-1;
  67. end
  68.  
  69. PROCEDURE KembalikanBuku(Input/Output c : Buku )
  70. /* I.S. <-- Mengakses buku yang akan dikembalikan */
  71. /* F.S. <-- Mengembalikan buku dan menambah jumlah ketersediaannya*/
  72. Kamus
  73. Algoritma
  74. begin
  75. b.Jumlah <-- b.Jumlah+1;
  76. end
  77. PROCEDURE InputData(IN/OUT Buku d)
  78. /*I.S. <-- Menentukan tipe data tujuan */
  79. /*F.S. <-- Memasukkan isi data ke dalam ADT Tujuan */
  80. Kamus
  81. Algoritma
  82. Begin
  83. Output(“\n masukkan Judul buku :);
  84. Input(d.judul);
  85. Output(“\n masukkan Nama Pengarang buku :);
  86. Input(d.pengarang);
  87. Output(“\n masukkan Tahun Terbit buku :);
  88. Input(d.TahunTerbit);
  89. Output(“\n masukkan Jumlah Total buku :);
  90. Input(d.Total);
  91. Output(“\n Input Data berhasil dilakukan”);
  92. end
  93. PROCEDURE TampilkanData(IN/OUT Buku d)
  94. /*I.S. <-- Mendapatkan data Buku */
  95. /*F.S. <-- Menampilkan data Buku */
  96. Kamus
  97. Algoritma
  98. Begin
  99. Output(“\n Judul Buku :,d.judul);
  100. Output(“\n Pengarang :,d.pengarang);
  101. Output(“\n Tahun Terbit :,d.TahunTerbit);
  102. Output(“\n Jumlah yang Tersedia :,d.Total-d.Pinjam);
  103. end
  104.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Manajemen_Buku’
prog.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Buku’
prog.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:9: error: expected identifier or ‘(’ before ‘>’ token
prog.c:25: warning: data definition has no type or storage class
prog.c:25: warning: type defaults to ‘int’ in declaration of ‘x’
prog.c:25: warning: type defaults to ‘int’ in declaration of ‘y’
prog.c:25: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
prog.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘output’
prog.c:28: error: stray ‘\342’ in program
prog.c:28: error: stray ‘\200’ in program
prog.c:28: error: stray ‘\234’ in program
prog.c:28: error: stray ‘\342’ in program
prog.c:28: error: stray ‘\200’ in program
prog.c:28: error: stray ‘\235’ in program
prog.c:29: error: stray ‘\342’ in program
prog.c:29: error: stray ‘\200’ in program
prog.c:29: error: stray ‘\234’ in program
prog.c:29: error: expected declaration specifiers or ‘...’ before numeric constant
prog.c:29: error: stray ‘\342’ in program
prog.c:29: error: stray ‘\200’ in program
prog.c:29: error: stray ‘\235’ in program
prog.c:29: warning: data definition has no type or storage class
prog.c:29: warning: type defaults to ‘int’ in declaration of ‘output’
prog.c:30: error: stray ‘\342’ in program
prog.c:30: error: stray ‘\200’ in program
prog.c:30: error: stray ‘\234’ in program
prog.c:30: error: expected declaration specifiers or ‘...’ before numeric constant
prog.c:30: error: stray ‘\342’ in program
prog.c:30: error: stray ‘\200’ in program
prog.c:30: error: stray ‘\234’ in program
prog.c:30: warning: data definition has no type or storage class
prog.c:30: warning: type defaults to ‘int’ in declaration of ‘output’
prog.c:31: error: stray ‘\342’ in program
prog.c:31: error: stray ‘\200’ in program
prog.c:31: error: stray ‘\234’ in program
prog.c:31: error: expected declaration specifiers or ‘...’ before numeric constant
prog.c:31: error: stray ‘\342’ in program
prog.c:31: error: stray ‘\200’ in program
prog.c:31: error: stray ‘\235’ in program
prog.c:31: warning: data definition has no type or storage class
prog.c:31: warning: type defaults to ‘int’ in declaration of ‘output’
prog.c:32: error: stray ‘\342’ in program
prog.c:32: error: stray ‘\200’ in program
prog.c:32: error: stray ‘\234’ in program
prog.c:32: error: expected declaration specifiers or ‘...’ before numeric constant
prog.c:32: error: stray ‘\342’ in program
prog.c:32: error: stray ‘\200’ in program
prog.c:32: error: stray ‘\235’ in program
prog.c:32: warning: data definition has no type or storage class
prog.c:32: warning: type defaults to ‘int’ in declaration of ‘output’
prog.c:33: error: stray ‘\342’ in program
prog.c:33: error: stray ‘\200’ in program
prog.c:33: error: stray ‘\234’ in program
prog.c:33: error: expected declaration specifiers or ‘...’ before numeric constant
prog.c:33: error: stray ‘\342’ in program
prog.c:33: error: stray ‘\200’ in program
prog.c:33: error: stray ‘\235’ in program
prog.c:33: warning: data definition has no type or storage class
prog.c:33: warning: type defaults to ‘int’ in declaration of ‘output’
prog.c:34: error: stray ‘\342’ in program
prog.c:34: error: stray ‘\200’ in program
prog.c:34: error: stray ‘\234’ in program
prog.c:34: error: expected ‘)’ before ‘pilihan’
prog.c:34: error: stray ‘\342’ in program
prog.c:34: error: stray ‘\200’ in program
prog.c:34: error: stray ‘\234’ in program
prog.c:35: warning: data definition has no type or storage class
prog.c:35: warning: type defaults to ‘int’ in declaration of ‘input’
prog.c:35: warning: parameter names (without types) in function declaration
prog.c:36: error: expected identifier or ‘(’ before ‘while’
prog.c:36: error: stray ‘\342’ in program
prog.c:36: error: stray ‘\200’ in program
prog.c:36: error: stray ‘\230’ in program
prog.c:36: error: stray ‘\342’ in program
prog.c:36: error: stray ‘\200’ in program
prog.c:36: error: stray ‘\231’ in program
prog.c:39: error: stray ‘\342’ in program
prog.c:39: error: stray ‘\200’ in program
prog.c:39: error: stray ‘\230’ in program
prog.c:39: error: stray ‘\342’ in program
prog.c:39: error: stray ‘\200’ in program
prog.c:39: error: stray ‘\231’ in program
prog.c:42: error: stray ‘\342’ in program
prog.c:42: error: stray ‘\200’ in program
prog.c:42: error: stray ‘\230’ in program
prog.c:42: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before numeric constant
prog.c:42: error: stray ‘\342’ in program
prog.c:42: error: stray ‘\200’ in program
prog.c:42: error: stray ‘\231’ in program
prog.c:45: error: stray ‘\342’ in program
prog.c:45: error: stray ‘\200’ in program
prog.c:45: error: stray ‘\230’ in program
prog.c:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before numeric constant
prog.c:45: error: stray ‘\342’ in program
prog.c:45: error: stray ‘\200’ in program
prog.c:45: error: stray ‘\231’ in program
prog.c:48: error: stray ‘\342’ in program
prog.c:48: error: stray ‘\200’ in program
prog.c:48: error: stray ‘\230’ in program
prog.c:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before numeric constant
prog.c:48: error: stray ‘\342’ in program
prog.c:48: error: stray ‘\200’ in program
prog.c:48: error: stray ‘\231’ in program
prog.c:51: error: stray ‘\342’ in program
prog.c:51: error: stray ‘\200’ in program
prog.c:51: error: stray ‘\230’ in program
prog.c:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before numeric constant
prog.c:51: error: stray ‘\342’ in program
prog.c:51: error: stray ‘\200’ in program
prog.c:51: error: stray ‘\231’ in program
prog.c:52: error: stray ‘\342’ in program
prog.c:52: error: stray ‘\200’ in program
prog.c:52: error: stray ‘\234’ in program
prog.c:52: error: stray ‘\342’ in program
prog.c:52: error: stray ‘\200’ in program
prog.c:52: error: stray ‘\235’ in program
prog.c:54: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘end’
prog.c:60: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Begin’
prog.c:61: error: stray ‘\342’ in program
prog.c:61: error: stray ‘\200’ in program
prog.c:61: error: stray ‘\234’ in program
prog.c:61: error: stray ‘\342’ in program
prog.c:61: error: stray ‘\200’ in program
prog.c:61: error: stray ‘\234’ in program
prog.c:62: warning: data definition has no type or storage class
prog.c:62: warning: type defaults to ‘int’ in declaration of ‘Input’
prog.c:62: warning: parameter names (without types) in function declaration
prog.c:63: error: expected ‘)’ before ‘.’ token
prog.c:64: error: stray ‘\342’ in program
prog.c:64: error: stray ‘\200’ in program
prog.c:64: error: stray ‘\234’ in program
prog.c:64: error: stray ‘\342’ in program
prog.c:64: error: stray ‘\200’ in program
prog.c:64: error: stray ‘\235’ in program
prog.c:66: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘b’
prog.c:69: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PROCEDURE’
prog.c:77: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PROCEDURE’
prog.c:83: error: stray ‘\342’ in program
prog.c:83: error: stray ‘\200’ in program
prog.c:83: error: stray ‘\234’ in program
prog.c:83: error: stray ‘\’ in program
prog.c:83: error: stray ‘\342’ in program
prog.c:83: error: stray ‘\200’ in program
prog.c:83: error: stray ‘\235’ in program
prog.c:84: error: expected ‘)’ before ‘.’ token
prog.c:85: error: stray ‘\342’ in program
prog.c:85: error: stray ‘\200’ in program
prog.c:85: error: stray ‘\234’ in program
prog.c:85: error: stray ‘\’ in program
prog.c:85: error: expected ‘)’ before ‘masukkan’
prog.c:85: error: stray ‘\342’ in program
prog.c:85: error: stray ‘\200’ in program
prog.c:85: error: stray ‘\235’ in program
prog.c:86: error: expected ‘)’ before ‘.’ token
prog.c:87: error: stray ‘\342’ in program
prog.c:87: error: stray ‘\200’ in program
prog.c:87: error: stray ‘\234’ in program
prog.c:87: error: stray ‘\’ in program
prog.c:87: error: expected ‘)’ before ‘masukkan’
prog.c:87: error: stray ‘\342’ in program
prog.c:87: error: stray ‘\200’ in program
prog.c:87: error: stray ‘\235’ in program
prog.c:88: error: expected ‘)’ before ‘.’ token
prog.c:89: error: stray ‘\342’ in program
prog.c:89: error: stray ‘\200’ in program
prog.c:89: error: stray ‘\234’ in program
prog.c:89: error: stray ‘\’ in program
prog.c:89: error: expected ‘)’ before ‘masukkan’
prog.c:89: error: stray ‘\342’ in program
prog.c:89: error: stray ‘\200’ in program
prog.c:89: error: stray ‘\235’ in program
prog.c:90: error: expected ‘)’ before ‘.’ token
prog.c:91: error: stray ‘\342’ in program
prog.c:91: error: stray ‘\200’ in program
prog.c:91: error: stray ‘\234’ in program
prog.c:91: error: stray ‘\’ in program
prog.c:91: error: expected ‘)’ before ‘Input’
prog.c:91: error: stray ‘\342’ in program
prog.c:91: error: stray ‘\200’ in program
prog.c:91: error: stray ‘\235’ in program
prog.c:93: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PROCEDURE’
prog.c:99: error: stray ‘\342’ in program
prog.c:99: error: stray ‘\200’ in program
prog.c:99: error: stray ‘\234’ in program
prog.c:99: error: stray ‘\’ in program
prog.c:99: error: stray ‘\342’ in program
prog.c:99: error: stray ‘\200’ in program
prog.c:99: error: stray ‘\234’ in program
prog.c:100: error: stray ‘\342’ in program
prog.c:100: error: stray ‘\200’ in program
prog.c:100: error: stray ‘\234’ in program
prog.c:100: error: stray ‘\’ in program
prog.c:100: error: expected ‘)’ before ‘Pengarang’
prog.c:100: error: stray ‘\342’ in program
prog.c:100: error: stray ‘\200’ in program
prog.c:100: error: stray ‘\234’ in program
prog.c:101: error: stray ‘\342’ in program
prog.c:101: error: stray ‘\200’ in program
prog.c:101: error: stray ‘\234’ in program
prog.c:101: error: stray ‘\’ in program
prog.c:101: error: expected ‘)’ before ‘Tahun’
prog.c:101: error: stray ‘\342’ in program
prog.c:101: error: stray ‘\200’ in program
prog.c:101: error: stray ‘\234’ in program
prog.c:102: error: stray ‘\342’ in program
prog.c:102: error: stray ‘\200’ in program
prog.c:102: error: stray ‘\234’ in program
prog.c:102: error: stray ‘\’ in program
prog.c:102: error: expected ‘)’ before ‘Jumlah’
prog.c:102: error: stray ‘\342’ in program
prog.c:102: error: stray ‘\200’ in program
prog.c:102: error: stray ‘\234’ in program
prog.c:103: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ at end of input
stdout
Standard output is empty