Monday
July 28, 2014

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

computer programming - small startup software developer company needs to create ...
computer Programming - A small startup software developer company needs to ...
programing - small startup software developer company needs to create a program...
Programming with Eclipse - Design, implement, test, and debug an application to ...
devry - A small startup software developer company needs to create a program ...
programming - write a payroll program that promt a user to enter his name,hourly...
programing - A small startup software developer company needs to create a ...
programming MIPS ask - Write a MIPS assembly language program that will cover ...
Java - You are to create an efficient OO application to be used by the wait ...
programming - A small startup software developer company needs to create a ...

Search
Members