I realize that people on here are not supposed to do homework for other people, but this particular assignment has been driving me up the wall for 2 months now. It's for a self-paced online class so i really have no one to turn to and ask for help. I'm seriously pulling my hair out. Pretty sure i'm making it much more complicated than it needs to be. Here is the basic premise of the problem with my code so far following after it. I will provide comments in the code section on where i need help.
We are given a file of employees and their corresponding employee ID numbers and the sales they make in a given day. We are supposed to print out a file that shows total employee sales per quarter of the day. An example of the final print out would be as follows:
Hour of the day 00 (this being 0:00 - 06:00 or 06:00 - 12:00 etc)
Employee Name Total Sales Commissions
XXXXXXXX 99.99 99.99
start perform readData() while not eof perform readIntoMemory() count = count + 1 endwhile SIZE = count perform totalSalesCalc() perform closeUp() stop readData() DECLARE VARIABLES char mainHeading1 = "HOUR OF THE DAY " char mainHeading2 = "EMPLOYEE TOTAL TOTAL" char mainHeading3 = "NAME SALES COMMISSIONS" num empIDNum = 103 num empIDNum = 104 num empIDNum = 201 num empIDNum = 319 num empIDNum = 367 num empIDNum = 375 num empIDNum = 400 char empName = "Edwards" char empName = "Rogers" char empName = "Krybek" char empName = "Delaney" char empName = "LaFleur" char empName = "Smith" char empName = "Black" num empTotalSales  all = 0 num commissionRate = .04 num commissionRate = .05 num commissionRate = .06 num commissionRate = .07 num commissionRange = 0 num commissionRange = 51000 num commissionRange = 126000 num commissionRange = 201000 num saleTime = 0000 num saleTime = 0600 num saleTime = 1300 num saleTime = 1900 num saleTime = 2400 num salesPerson num month num day num year num time num salesAmount num salesPerson num month num day num year num time num salesAmount num SIZE // keep track of size of arrays read into memory num x num a num b num rate num commission = 0 num prevEmp open files read saleRecord return readIntoMemory() salesPerson[count] = salesPerson month[count] = month day[count] = day year[count] = year time[count] = time salesAmount[count] = salesAmount return totalSalesCalc() count = 0 while count <= SIZE perform hourBreak() count = count + 1 endwhile return hourBreak() b = 0 while b < 4 if time > saleTime[b] & time < saleTime[b + 1] print mainHeading1, saleTime[b], "THRU", saleTime[b + 1] print mainHeading2 print mainHeading3 else endif endwhile perform empBreak() return empBreak() //this is where i'm getting seriously mixed up. I keep thinking of using while loop with a series of nested if statements to match the employees with the sales but keep on confusing myself to no end return getSales() x =0 while salesPerson not equal empIDNum[x] x = x + 1 endwhile empTotalSales[x] = empTotalSales[x] + salesAmount return determineCommission() a = 3 while a >= 3 if empTotal[x] >= commissionRange[a] rate = commissionRate[a] a = -1 else a = a - 1 endif endwhile commission = empTotal[x] * rate print empName[x], empTotal[x], commission return closeUp() closefiles return
Any help on this would be greatly appreciated as i'm stuck in a rut and pulling out my hair. Thank you very much in advance.