我正在尝试制作一个计算机咖啡厅系统,我的问题是如何将输入值以小时数添加到当前时间,例如现在的时间是11.30,输入值是5,因此结束时间将是4:30
IDENTIFICATION DIVISION.
PROGRAM-ID. Example.
AUTHOR. Lee Martin Flores.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MachineNo PIC 99 VALUE ZEROS.
01 Hours PIC 99 VALUE ZEROS.
01 Result PIC 99 VALUE ZEROS.
01 Charge PIC 99 VALUE 10.
01 EndTime PIC 9999 VALUE ZEROS.
01 CurrentTime.
02 CurrentHour PIC 99.
02 CurrentMinute PIC 99.
02 FILLER PIC 9(4).
PROCEDURE DIVISION.
DISPLAY "Enter Machine No : ".
Accept MachineNo.
DISPLAY "How Many Hours: ".
Accept Hours.
MULTIPLY Hours BY Charge GIVING Result.
DISPLAY "Enter Current Time : ".
ACCEPT CurrentTime FROM TIME.
ADD CurrentTime TO Hours GIVING EndTime.
DISPLAY "Machine No : ", MachineNo.
DISPLAY "The Time is " CurrentHour ":" CurrentMinute.
DISPLAY "Number of Hours : ", Hours.
DISPLAY "Charge Per Hour: ", Charge.
DISPLAY "Total Charge/Amount: ", Result.
DISPLAY "End Time is : ", EndTime
STOP RUN.
我遇到问题时遇到问题: 31 E预期数字项目;找到'CurrentTime' 并且显示结束时间的代码是否正确?