Tuesday
May 21, 2013

Homework Help: Computer Programming

Posted by Paul on Tuesday, April 3, 2012 at 2:07pm.

I need a check on my answers

1) prompt a user to enter an employee name, employee id, and hours worked until a value of "-1" is entered for employye name.
my answer:
Start
Declarations
num EmployId, HrsWrked
string EmployName
housework()
detailLoop()
Stop

housework()
output "Please enter Employee Name"
input EmployName
output "Please enter Employee ID number"
input EmployId
output "Please enter Hours Worked"
input HrsWrked
return

detailLoop()
check if EmployName = -1
while EmployName < > -1
output "Please enter Employee Name"
input EmployName
output "Please enter Employee ID number"
input EmployId
output "Please enter Hours Worked"
input HrsWrked
check if EmployName = -1
endwhile
return


2) If the employee id is not between 1 and 599, continue to prompt the user until a valid employee id is entered.
my answer:
Start
Declarations
num EmployId, HrsWrked
string EmployName
housework()
detailLoop()
Stop

housework()
output "Please enter Employee Name"
input EmployName
output "Please enter Employee ID number"
input EmployId
output "Please enter Hours Worked"
input HrsWrked
return

detailLoop()
check if EmployName = -1
while EmployName < > -1
check if EmployID is >= 1 and <= 599
if EmployID is <1 or > 599
output "Incorrect Employee ID number, Please enter ID value 1- 599"
input EmployId
endif
output "Please enter Employee Name"
input EmployName
output "Please enter Employee ID number"
input EmployId
output "Please enter Hours Worked"
input HrsWrked
check if EmployName = -1

endwhile
return

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

programming - write a program in C# that calculates and prints the take home pay...
programming - write a payroll program that promt a user to enter his name,hourly...
computer programming - small startup software developer company needs to create ...
business - can someone help me with some information on each one of this. ...
business - can someone help me with some information on each one of this. ...
business accounting - can someone help me with some information on each one of ...
computer Programming - A small startup software developer company needs to ...
Programming with Eclipse - Design, implement, test, and debug an application to ...
Java - You are to create an efficient OO application to be used by the wait ...
programming MIPS ask - Write a MIPS assembly language program that will cover ...

For Further Reading

Search
Members
Community