Respond to this messageReturn to Index
Original Message
  • Display corrected
    • Solitaire (Login Solitaire1)
      Posted Apr 28, 2012 6:37 PM

      I rearranged some of your statements so that it will display properly. You had the headings wrong -- each of the titles and underlines should be enclosed separately within quotation marks, with commas in-between. That should be done before starting the DO loop. You do not need the READ statement before starting the loop.

      I believe you meant to read the Sales, not the Salary, so I made that change in the READ statement. Also, you don't have any data with "xxx" so I changed it to the last name - "Lew" Remember, your data needs to match the number of items in the READ statement or you will get an "Out of Data" error.

      PRINT "Employee name", "SALES", "Comm", "Bonus", "Salary"
      PRINT "-------------", "-----", "----", "-----", "------"
      DO WHILE Names$ <> "Lew"
      READ Names$, Sales
      Comm = Sales * .1
      IF Sales >= 80000 THEN Bonus = 500 ELSE Bonus = 0
      Salary = Comm + Bonus + 10000
      GT = Gross + Sales
      PRINT Names$, Sales, Comm, Bonus, Salary
      DATA "Heather",90000,"Sam",70000,"Dan",20000,"Robert",95000,"Lew",40000
    Your Name
    Message Title
    Message Text

     Copyright © 1999-2015 Network54. All rights reserved.   Terms of Use   Privacy Statement