help with program
Posted: Tue Sep 28, 2004 10:46 pm
Can someone please help me. I have written two programs. The first programs will run up to the rows of info then it will put in end for the name and the end total and not each number then a total. I've been working on this for a week. Please help
'***********Program Mainline***********
CLS
GOSUB InitializeImages
GOSUB ProcessDetail
END
'**********Initialize Print Images******
InitializeImages:
LET T1$ = " Recording Studio Rent Charges"
LET H1$ = " Group Name Mintues Used Charges"
LET D1$ = " \ \ #### $#,###.##"
LET TL$ = " "
RETURN
'*********Process Detil*******************
ProcessDetail:
CLS
PRINT TAB(25); "Recording Studio Rent Charges"
GOSUB InputData
DO UNTIL UCASE$(Name$) = "END"
GOSUB inputMinutes
GOSUB CalculateCharge
PRINT
GOSUB InputData
LOOP
GOSUB PrintTitleAndHeader
GOSUB Summarize
GOSUB PrintOutput
RETURN
'*********Input Data**********************
CLS
InputData:
PRINT
INPUT "Name of group (END to Quit)"; Name$
RETURN
'********Input Minutes***************
inputMinutes:
INPUT "Enter Minutes used"; Minutes
RETURN
'*********CalculateCharge*************
CalculateCharge:
LET hourrate = 200
LET Rate = (hourrate / 60) * Minutes
LET Charge = INT(Rate * 100 + .5) / 100
PRINT
LET TotalMinutes = TotalMinutes + Minutes
LET TotalCharge = TotalCharge + Charge
RETURN
'***********Summarize****************
Summarize:
PRINT USING D1$; Name$; Minutes; TotalCharge
RETURN
'*********PrintTitleAndHeader**********
PrintTitleAndHeader:
PRINT
PRINT TAB(20); T1$
PRINT
PRINT H1$
RETURN
'*********Print Output********************
PrintOutput:
PRINT
PRINT "Total Charge for All Groups"; TotalCharge;
RETURN
'****************EndofProgram**************
'***********Program Mainline***********
CLS
GOSUB InitializeImages
GOSUB ProcessDetail
END
'**********Initialize Print Images******
InitializeImages:
LET T1$ = " Recording Studio Rent Charges"
LET H1$ = " Group Name Mintues Used Charges"
LET D1$ = " \ \ #### $#,###.##"
LET TL$ = " "
RETURN
'*********Process Detil*******************
ProcessDetail:
CLS
PRINT TAB(25); "Recording Studio Rent Charges"
GOSUB InputData
DO UNTIL UCASE$(Name$) = "END"
GOSUB inputMinutes
GOSUB CalculateCharge
GOSUB InputData
LOOP
GOSUB PrintTitleAndHeader
GOSUB Summarize
GOSUB PrintOutput
RETURN
'*********Input Data**********************
CLS
InputData:
INPUT "Name of group (END to Quit)"; Name$
RETURN
'********Input Minutes***************
inputMinutes:
INPUT "Enter Minutes used"; Minutes
RETURN
'*********CalculateCharge*************
CalculateCharge:
LET hourrate = 200
LET Rate = (hourrate / 60) * Minutes
LET Charge = INT(Rate * 100 + .5) / 100
LET TotalMinutes = TotalMinutes + Minutes
LET TotalCharge = TotalCharge + Charge
RETURN
'***********Summarize****************
Summarize:
PRINT USING D1$; Name$; Minutes; TotalCharge
RETURN
'*********PrintTitleAndHeader**********
PrintTitleAndHeader:
PRINT TAB(20); T1$
PRINT H1$
RETURN
'*********Print Output********************
PrintOutput:
PRINT "Total Charge for All Groups"; TotalCharge;
RETURN
'****************EndofProgram**************