PLease Help
Posted: Thu May 01, 2008 7:46 am
Hi im so exited i had bearly started to mess arround with QBASik currently in my school they asked us to develop a program that reads information from a file
"NAME" "SSN" "WAGE"
"CHARLOTTE JONES","654928412",30520.9
and to print a list of this information and accumulate the combined wages, i was able to accomplish that however the teacher last night asked us to have the program add "-" character to format the SSN "000-00-0000" instead of printing it like "000000000" like it does now, next ill post the Code i have developed.
Thanks in advanced im Going NuTS trying to solve this.
"NAME" "SSN" "WAGE"
"CHARLOTTE JONES","654928412",30520.9
and to print a list of this information and accumulate the combined wages, i was able to accomplish that however the teacher last night asked us to have the program add "-" character to format the SSN "000-00-0000" instead of printing it like "000000000" like it does now, next ill post the Code i have developed.
Thanks in advanced im Going NuTS trying to solve this.
Code: Select all
CLS
PRINT TAB(22); "Selected Employees (SSN > 599999999)"
PRINT
Chead$ = "Name SSN WAGE"
Uline$ = "---- --- ----"
detline$ = "\ \ \ \##,###.##"
detlin$ = " \ \##,###.##"
tot! = 0
OPEN "H:\SWC\CIS101\prog\test.txt" FOR INPUT AS #1
PRINT TAB(13); Chead$;
PRINT TAB(13); Uline$;
DO
INPUT #1, nam$, ssn$, wage!
IF ssn$ > "599999999" THEN
PRINT TAB(13); USING detline$; nam$; ssn$; wage!
tot! = tot! + wage!
END IF
LOOP UNTIL (EOF(1))
PRINT
PRINT USING detlin$; "Total Wages:"; tot!