Got program to run it but then I get an error messageby (no login)Good evening everyone, finally got the hang of creating programs and getting them to run but I run into the problem where the data,title, headings are duplicated. This happens to all my programs. Can someone take a look at the programming and let me know what command or programming I put in, that is causing this annoyance. Also I received an error message on line 54 indicating "Out of Data". Any reason why. Thought I ended the data. Any advice would be appreciated. '**************************************************************************** '* THIS PROGRAM IS TO CALCULATE EACH SALES PERSON'S EARNINGS * '**************************************************************************** ' VARIABLES USED: ' T1$, H1$, D1$, Print Images ' NAM$ Employee Name ' EMPLOYEE SALES Employee Sales Earned ' EMPLOYEE SALARY Employee Total Salary '*************************** PROGRAM VARIABLES ***************************** CLS GOSUB InitializeVariables GOSUB PrintHeadings GOSUB ProcessDetail GOSUB CalculateAnswer END '***************************** INITIALIZE VARIABLES ************************* InitializeVariables: LET T1$ = " EARNED SALARIES " LET H1$ = " EMPLOYEE NAME EMPLOYEE SALES EMPLOYEE SALARY " LET D1$ = " \ \ ###,###.## ###,###.## " '**************************** PRINT HEADINGS ******************************** PrintHeadings: PRINT T1$ 'PRINT TITLE LINE PRINT H1$ 'HEADING LINE RETURN '*************************** PROCESS DETAIL ********************************* ProcessDetail: GOSUB ReadData DO UNTIL UCASE$(NAM$) = "END" GOSUB CalculateAnswer GOSUB PrintDetail GOSUB ReadData LOOP RETURN '******************************* READ DATA *********************************** ReadData: READ EmployeeName$, EmployeeSales, EmployeeSalary DATA "Carlos Ortiz",90000,00 DATA "Jill Johnson",70000,00 DATA "Don Williams",20000,00 DATA "Dee Jones",95000,00 DATA "Al Ennis",40000,00 DATA "End" RETURN '******************************* CALCULATE ANSWER **************************** CalculateAnswer: IF EmployeeSales > 80000 THEN LET EmployeeSalary = (EmployeeSales + 500) ELSE LET EmployeeSalary = EmployeeSales END IF '******************************* PRINT DETAIL ******************************** PrintDetail: PRINT USING D1$; EmployeeName$, EmployeeSales, EmployeeSalary RETURN END '****************************** END OF PROGRAM ***********************************
|
| Response Title | Author and Date |
| response. | on Aug 3 |