06-07-2003, 07:55 PM
I need to write a program that lets you enter a band name and the number of minutes of studio time. Then out put a list of the bands, their total number of minutes, and the studio charge ($200 per hour), then give a total on the minutes and charges...
The output should look like this:
Band Minutes Charge
The Birds 60 $200
The Monkeys 120 $400
the Pandas 60 $200
total Minutes: 240 Total charges $800
I'm having trouble with getting my output formatted correctly. We are just now getting into loops and the "Print Using" statement so I need to utilize them in my program. Any help would very much be appreciated...
Here is my code:
CLS
GOSUB initializeimages
GOSUB processdetail
GOSUB printtotal
END
'**************** Initialize print images***************
initializeimages:
LET H1$ = "Group Name Minutes Used charges "
LET d1$ = "\ \ #### ###.## "
LET T1$ = " Total Minutes:##### Total Charges: ####.##"
RETURN
'**************** Process Detail *************************
processdetail:
INPUT "Enter group name or 000 to quit"; nam$
DO UNTIL UCASE$(name$) = "000"
INPUT "Enter total minutes"; minutes
rate = 200 / 60
subtotal = rate * minutes
total = total + subtotal
INPUT "Enter group name or 000 to quit"; name$
PRINT USING d1$; nam$; minutes; total
LOOP
RETURN
'*************** Print totals *****************************
printtotal:
PRINT H1$
PRINT
PRINT USING T1$; minutes; total
RETURN
'*******************End of Program********************
The output should look like this:
Band Minutes Charge
The Birds 60 $200
The Monkeys 120 $400
the Pandas 60 $200
total Minutes: 240 Total charges $800
I'm having trouble with getting my output formatted correctly. We are just now getting into loops and the "Print Using" statement so I need to utilize them in my program. Any help would very much be appreciated...
Here is my code:
CLS
GOSUB initializeimages
GOSUB processdetail
GOSUB printtotal
END
'**************** Initialize print images***************
initializeimages:
LET H1$ = "Group Name Minutes Used charges "
LET d1$ = "\ \ #### ###.## "
LET T1$ = " Total Minutes:##### Total Charges: ####.##"
RETURN
'**************** Process Detail *************************
processdetail:
INPUT "Enter group name or 000 to quit"; nam$
DO UNTIL UCASE$(name$) = "000"
INPUT "Enter total minutes"; minutes
rate = 200 / 60
subtotal = rate * minutes
total = total + subtotal
INPUT "Enter group name or 000 to quit"; name$
PRINT USING d1$; nam$; minutes; total
LOOP
RETURN
'*************** Print totals *****************************
printtotal:
PRINT H1$
PRINT USING T1$; minutes; total
RETURN
'*******************End of Program********************