Hi,
I deseparetly need help on designing a pseudocode for this program. I am new to programming, and totally lost. I started on it, but it doesn't seem right so could someone please check for me and help me out. I really need help! Here is the problem that I was given: 2. Create an application that continues to prompt the user for employee data and writes a report that contains a line for each employee. The application continues until the user enters 0 for an ID number to indicate the desire to quit. While the ID number is not 0, prompt the user for a value for each employee’s first and last names, street address, zip code, and job description code.
Any time the user enters an invalid value, continue to re-prompt the user for the same data. Invalid values are:
An employee ID number that is negative or greater than 999
A zip code that is not in the list of allowed zip codes
A job description code that is not between 10 and 19 inclusive
Determine the employee’s city and state based on the zip code using the following table:
Zip Code City State
20175 Leesburg VA
20132 Purcellville VA
20164 Ashburn VA
20165 Potomac Falls VA
20113 Clinton MD
20112 Camp Springs
Determine the employee’s job title based on the following values. Determine the employee’s hourly pay rate based on the values in the following table. (Contract employees have an hourly rate of $0.)
Job Code Title
10 Desk Clerk
11 Credit Checker
12 Billing
13 Car cleaner
14 Chauffeur
15 Marketer
16 Accountant
17 CEO
18 Contract
Job Code Hourly Pay Rate($)
10-13 19.00
14-15 24.50
16-17 40.00
18 85.00
19 0.00
When all the needed data has been entered correctly for an employee, print the ID number, first and last names, street address, city, state, zip code, job code, job title, and hourly pay rate for each employee, and prompt the user for the next ID number. At the end of the report, print the following summaries:
A count of the number of employees in each job code
A count of the number of employees who live in each zip code
Flowchart and pseudocode the design.
This is the code i came up with:
START
20175 count <-- 0
20132 count <-- 0
20164 count <-- 0
20165 count <-- 0
20113 count <-- 0
20112 count <-- 0
job 10 count <-- 0
job 11 count <-- 0
job 12 count <-- 0
job 13 count <-- 0
job 14 count <-- 0
job 15 count <-- 0
job 16 count <-- 0
job 17 count <-- 0
job 18 count <-- 0
Write prompt message
Read id #, empfirstname, emplastname, st.address, zipcode, jobcode
DOWHILE id# =/= 0
valid data <-- true
IF id# < 0 or id# > 999 THEN
valid data <-- false
Write id#, empfirstname, emplastname, st.address, zipcode, jobcode, 'ID number cannot be negative or greater than 999'
ENDIF
IF zipcode =/= '20175' or zipcode =/= '20132' or zipcode =/= '20164' or zipcode =/= '20165' or zipcode =/= '20113' or zipcode =/= '20112' THEN
valid data <-- false
Write id#, empfirstname, emplastname, st.address, zipcode, jobcode, 'Zipcode must be 20175, 20132, 20164, 20165, 20113, or 20112'
ENDIF
IF jobcode < 10 and jobcode > 19 THEN
valid data <-- false
Write id#, empfirstname, emplastname, st.address, zipcode, jobcode,'Job description code must be b/w 10 and 19 inclusive.'
ENDIF
IF valid data = true THEN
IF zipcode = '20175' THEN
city <-- 'Leesburg'
state <-- 'Virginia'
20175 count <-- 20175 count + 1
ELSE
IF zipcode = '20132' THEN
city <-- 'Purcellville'
state <-- 'Virginia'
20132 count <-- 20132 count + 1
ELSE
IF zipcode = '20164' THEN
city <-- 'Ashburn
state <-- 'Virginia'
20164 <-- 20164 count + 1
ELSE
IF zipcode = '20165' THEN
city <-- Potomac Falls
state <-- Virginia
20165 count <-- 20165 count + 1
ELSE
IF zipcode = '20113' THEN
city <-- Clinton
state <-- Maryland
20113 count <-- 20113 count + 1
ELSE
city <-- Camp Springs
20112 count <-- count + 1
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
IF jobcode = '10' THEN
jobtitle <-- 'Desk Clerk'
hrly$ <-- 19.00
job 10 count <-- job10count + 1
ELSE
IF jobcode = '11' THEN
jobtitle <-- 'Credit Checker'
hrly$ <-- 19.00
job 11 count <-- job11count + 1
ELSE
IF jobcode = '12' THEN
jobtitle <-- Billing
hrly$ <-- 19.00
job12count <-- job12count + 1
Also Here is the defining diagram I came up with:
INPUT
id#
empfirstname
emplastname
st.address
zipcode
jobcode
PROCESSING
-prompt use for employee data
-read employee data
-display employee information
-determine hourly pay
-determine job title
-determine location infromation
-determine statistics
OUTPUT
id#
empfirstname
emplastname
st.address
city
state
jobcode
jobtitle
hrly$
counts
Can someone please help me? Examples very similar to this one could help. This assignment is due Thursday, July 1st.