Real Number and Average Salary

Topics: Real number, Mathematics, Integer Pages: 4 (473 words) Published: February 17, 2013
e array

Associate Program Material

Simple Array Process

Input a list of employee names and salaries, and determine the mean (average) salary as well as the number of salaries above and below the mean.

                   Display Program Title
                   Give instructions on the program                    Open file for interactive input (write)                    Prompt for Names and Salaries                    Check for negative numbers                    Check for sentinel value Loop until sentinel value is entered

Get running total for Sum
Get running total for Count
Write input values to file
Close file after input
Determine if count is equal or greater than 1
Calculate average salary
Display average salary
Prompt for input Response
Determine if user wants to continue
Open file for batch processing (read)
Loop for processing file
Read salary field
Gather running total for both count variables
When the loop reaches EOF close file
Display count variables as output
                   Input Name (Name: String)                    Input Salary (Salary: Real)           Output
                   Display Average salary
                   Display Count_2 above average salary                    Display Count_3 below average salary

Main Module
          Declare Name, Response As String
          Declare Sum, Salaries, Average As Real
Declare Count, Count_2, Count_3 As Integer
          Write “               Welcome to the Payroll Program             ”           Write “”
          Write “This programs intended use is for you to enter a list”           Write “   of Names and Salaries into a file and output the   ”           Write “    the average salary from the list that is inputted.  ...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Real Number Essay
  • Real Numbers Essay
  • Real Numbers Essay
  • The Real Number System Essay
  • Real Numbers Essay
  • Axioms of Real Numbers Essay
  • Polynomials and Real Numbers Essay
  • Essay on Real Number and Pic

Become a StudyMode Member

Sign Up - It's Free