{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cis115_week7_lab_Vitold_Gregorarz

cis115_week7_lab_Vitold_Gregorarz - CIS115 Lab Solution...

This preview shows pages 1–8. Sign up to view the full content.

CIS115, Lab Solution WAVECREST ENGINEERING CIS115, Lab Solution Pay Calculator (v7.0) [Vitold Gregorarz] 4/17/2011 CIS115 Week7 Lab Solution (Pay Calculator, v7.0) Page 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This document specifies the complete analysis and design of the Pay Calculator program Contents
CIS115, Lab Solution 1. Problem Description (v7.0) A small startup software developer company needs to create a program that will calculate the pay of its employees. For  the first version of the program, the company wants the program to accept an employee’s name, the number of hours the  employee worked, and the hourly pay rate. The program will then calculate the gross pay, display the employee’s name,  number of hours worked, pay rate, and gross pay. 2. Requirements Analysis Input Variables: 1. employeeName, payRate, hoursWorked, y   Processes: 2.  multiply hoursWorked and payRate, deduct tax Output Variables: 3. employeeName, hoursWorked, payRate, grossPay, netPay, tax    3.  Hierarchy chart CIS115 Week7 Lab Solution (Pay Calculator, v7.0) Page 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Module main ( ) Module welcomeMessage ( ) Module enterInfo ( ) Module calculatePay ( ) Module displayInfo ( ) Module endmessage ( ) Function grossCalc ( ) Function netCalc ( ) CIS115, Lab Solution Design Figure 3:  Level 1 Control Flow Diagram                                 CIS115 Week7 Lab Solution (Pay Calculator, v7.0) Page 4
CIS115, Lab Solution Main Module Pseudocode Start         Module main() Declare constant integer SIZE = 250 Declare string employeeName[SIZE] Declare real payRate[SIZE] Declare real hoursWorked[SIZE] Declare real grossPay[SIZE]  Declare real tax[SIZE] Declare real netPay[SIZE]   Declare integer selection  Declare inputFile weekEmpPay  Declare integer index                                 Call welcomeMessage() Display “Choose from following menu options” Display “1. Calculate employee pay” Display “2. Display stored employee pay” Display “3. Quit” Display “Enter your selection”  Set selection = enterSelection() Select case selection Case 1: Call fileRead() CIS115 Week7 Lab Solution (Pay Calculator, v7.0) Page 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CIS115, Lab Solution Call calculatePay(hoursWorked[ ], payRate[ ]) Call displayInfo(employeeName[ ], hoursWorked[ ], payRate[ ], grossPay[ ], tax[ ], netPay[ ]) Call endMessage() End module Module welcomeMessage() Display “Welcome to employee pay calculator” End module Function enterSelection() Declare integer sel Input sel While sel <1 AND sel >3 Display “Invalid selection entered, please enter valid selection” Input sel Return sel End while End function Module fileRead() Open weekEmpPay “weeklyEmployeePay.dat” While (index <= SIZE -1) AND (NOT eof weekEmpPay) Read weekEmpPay employeeName[index] Read weekEmpPay payRate[index] CIS115 Week7 Lab Solution (Pay Calculator, v7.0) Page 6
CIS115, Lab Solution

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}