Sunday
April 20, 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 - can anyone give me site about programming I need a sample...
Computer Programming - How do I understand how Java programming works?
Computer Information - A __________ provides the tools that a programmer uses to...
computer - why are natural language not be suited for programming computer.
English - Let's write down what you can do with the computer. 1. I use the ...
computer - To all computer programmer or people know or use computer programming...
Computer Science - Can anyone tell me where one could find help and advice for a...
Programming - Hi. I am taking a computer programming class (C++). I need some ...
grammar - Diagram the simple subject, the simple predicate, and the direct ...
Computer science (Java programming) - Why are the use of GUIs and graphics ...

Search
Members