RESPONCE and further questions

by MATT (no login)

Thank you,
Here is what i ended up with. It seems to work. And yes, i am using QB64. The only problem that i am having now is I would like for RATE(X) AND GROSS(X) to print as currency with dollar signs. I am having difficulty singling them out when printing.

REM ** COMPANY PAYROLL REPORT **

CLS
INPUT "Enter total number of employees:", N
CLS
INPUT "Enter date of last day of the week (month/day/year):", DMY$

CLS
DIM NAMES(N) AS STRING
DIM RATE(N) AS SINGLE
DIM HOURS(N) AS SINGLE
DIM X AS INTEGER
DIM GROSS(N) AS SINGLE

FOR X = 1 TO N
INPUT "Enter name, hourly rate, hours worked (EXAMPLE:John Smith, 12.35, 40):", NAMES(X), RATE(X), HOURS(X)
NEXT X

CLS
PRINT "Payroll Report for Week Ending "; DMY$
PRINT
PRINT "Employee", "Hourly Rate", "Hours Worked", "Gross Pay"
PRINT

FOR X = 1 TO N
IF HOURS(X) > 40 THEN
HOURS(X) = ((HOURS(X) - 40) * 1.5) + 40
END IF
GROSS(X) = RATE(X) * HOURS(X)
PRINT NAMES(X), RATE(X), HOURS(X), GROSS(X)
NEXT X

TOTAL = 0

FOR X = 1 TO N
TOTAL = TOTAL + GROSS(X)
NEXT X

PRINT
PRINT "FINAL TOTAL", USING "$$###,###.##"; TOTAL

END





Posted on Apr 29, 2012, 8:19 PM

Respond to this message   

Return to Index


Response TitleAuthor and Date
I am not very familiar with PRINT USING, but... on Apr 29
 Re: I am not very familiar with PRINT USING, but...MATT on Apr 29