mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 04:12:13 +00:00
Add add programm to add item to the in-items file
This commit is contained in:
parent
38da2b91ce
commit
cae6ee8d5d
38
COBOL/Gnu/Add.cbl
Normal file
38
COBOL/Gnu/Add.cbl
Normal file
@ -0,0 +1,38 @@
|
||||
program-id. Add as "Add".
|
||||
|
||||
environment division.
|
||||
|
||||
input-output section.
|
||||
|
||||
file-control.
|
||||
select in-items assign 'in-items'.
|
||||
|
||||
data division.
|
||||
file section.
|
||||
fd in-items.
|
||||
01 item.
|
||||
02 sell-in pic s9(2).
|
||||
02 quality pic s9(2).
|
||||
02 name pic x(50).
|
||||
|
||||
working-storage section.
|
||||
01 accept-item.
|
||||
02 sell-in pic s9(2).
|
||||
02 quality pic s9(2).
|
||||
02 name pic x(50).
|
||||
|
||||
|
||||
procedure division.
|
||||
open extend in-items.
|
||||
display "name"
|
||||
accept name in accept-item.
|
||||
display "sell-in"
|
||||
accept sell-in in accept-item.
|
||||
display "quality"
|
||||
accept quality in accept-item.
|
||||
move accept-item to item.
|
||||
write item.
|
||||
close in-items.
|
||||
goback.
|
||||
|
||||
end program Add.
|
||||
Loading…
Reference in New Issue
Block a user