CIS105 - Programming Module
Lab Assignment 2 (turn in source code, sample output, and a flowchart) - Points: _____

The objective of this assignment is to process a batch of transactions using a DO WHILE LOOP. The input data is list of employees with pay rates and hours worked that must be used to calculate the net pay. An example of a similar program is attached as a reference.
Programming Environment: MS DOS QBASIC
      Start > Classes > Structured Classes > CIS105 > QBASIC
      Press ESCape to enter the editor

Enter the program you develop and save it on your floppy as A:PROG2.BAS.
      File -> Save As -> A:PROG2.BAS

Run the program by pressing F5 or by selecting Start under Run.

Use the Alt + Print Screen keys to capture a copy of the screen, and then 
paste it into a Word  document for printing.
This document is the sample output that needs to be turned in.

From QBASIC, print a copy of the source code to turn in:  
      File > Print

Required Formulas:
      IF hours > 40 THEN 
          gross = ((hours - 40) * rate * 1.5) + (rate * 40) 
      ELSE
         gross = rate * hours 
      END IF
      fed.tax = gross * .14
      net.pay = gross - fed.tax


Required Input Data:

              Name           Rate    Hours

              H. Johnson     4.95     41	
              B. Grant       6.00     39	
              R. Thomas      2.25     45
              J. Lopez       5.54     36
              M. Smith       8.95     37
              EOF            9.99     99
                   

Required Output Report:

   PROG2.BAS  Payroll Report by Juan Marquez            11-18-1999

   Name          Rate          Hours          Tax           Netpay

   H. Johnson     4.95          41            28.7595       176.6655
   B. Grant       6             39            32.76         201.24
   R. Thomas      2.25          45            14.9625       91.9125
   J. Lopez       5.54          36            27.9216       171.5184
   M. Smith       8.95          37            46.361        284.789

   Total Pay                                                926.1254

   Press Alt & Print Screen keys to capture the screen, and
   then press Enter to continue:



Assignment #2 Sample Source Code:

REM  PROG2.BAS (your name and class time goes here)
REM  Program to create a Sales Report of action figures sold

REM  Total  Numeric   Total Sales        Price  Numeric   Cost of item
REM  Item$  String    Item Description   Qty    Numeric   Quantity ordered
REM  Cost   Numeric   Qty x Price        Tax    Numeric   6% of Cost
REM  Order  Numeric   Total amount of order (Cost + Tax)

REM  *** Initialize Routine ***
LET Total = 0

CLS
PRINT "PROG2.BAS   Sales Report by Juan Marquez", DATE$
PRINT " "
PRINT "Item", "Price", "Qty", "Tax", "Order Amt"
PRINT " "

REM  *** Read First Record ***
READ Item$, Price, Qty

REM  *** Processing Control Test ***
DO WHILE Item$ <> "EOF"
  REM  *** Processing Routine ***
  REM  *** 5% markup when Qty <= 40
  IF Qty > 40 THEN
    LET Cost = Price * Qty
  ELSE
    LET Cost = Price * Qty * 1.05
  END IF
  LET Tax = Cost * .06
  LET Order = Cost + Tax
  LET Total = Total + Order

  REM  *** Output Routine ***
  PRINT Item$, Price, Qty, Tax, Order
  READ Item$, Price, Qty
LOOP

REM  *** Print Totals ***
PRINT " "
PRINT "Total Sales", " ", " ", " ", Total
PRINT " "
PRINT "Press Alt & Print Screen to capture the screen, and "
INPUT "then press Enter to continue: ", P

DATA "H. Johnson", 4.95, 41
DATA "B. Grant", 6.00, 39
DATA "R. Thomas", 2.25, 45
DATA "J. Lopez", 5.54, 36
DATA "M. Smith", 8.95, 37
DATA "EOF",9,99
END








Assignment #2 Sample Output:

PROG2.BAS   Sales Report by Juan Marquez       03-31-2000

Item          Price         Qty            Tax           Order Amt

H. Johnson     4.95          41            12.177        215.127
B. Grant       6             39            14.742        260.442
R. Thomas      2.25          45            6.075         107.325
J. Lopez       5.54          36            12.56472      221.9767
M. Smith       8.95          37            20.86245      368.5699

Total Sales                                              1173.441

Press Alt & Print Screen to capture the screen, and
then press Enter to continue:





Assignment #2 Sample flowchart:
Lab2 Flowchart

Revised: 7/30/2000 - www.mc.maricopa.edu/academic/business/cis105/basic/basic3_lab2.html