How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask LogicPro Your Own Question

LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 12627
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
29751445
Type Your Homework Question Here...
LogicPro is online now
A new question is answered every 9 seconds

In Pseudocode write a program that inputs a list of employees

This answer was rated:

In Pseudocode write a program that inputs a list of employees names and salaries, and determine the mean(average) salary as well as the number of salaries above and below the mean.
Program should consist of two matching arrays and counts of data. Calculations of data based on the array will be the final output to the user.
Hi,
Welcome back. Hope you are doing well.
What is the deadline for this?
Customer: replied 3 years ago.

9/11/2013

ok, I will provide you answer ASAP.
Download answer from here: SalaryAveragePseudocode.docx

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers.
It will ensure that question is for me.
Please bookmark my profile page:
http://www.justanswer.com/homework/expert-logicpro/
so you can come back and ask me a question anytime.

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and rate my answer as excellent. I can address follow up questions on original requirements at no extra charge and I’m always here to help.
Thank you for using JustAnswer!
Customer: replied 3 years ago.

LogicPro,


 


There were a couple of statements in your code that we do not use. For I = 0 to N-1 and the Next statement. See my comments within the code. Thank you for help and prompt response.


 


Start



  1. 1. Declare N as Integer = 20 //number of employees

  2. 2. Declare Names[N] as String //array to hold names of employees

  3. 3. Declare Salary[N] as Float //array to hold salaries of employees

  4. 4. Declare TotalSalary as Float //variable to store total salary

  5. 5. Declare AverageSalary as Float //variable for average salary

  6. 6. Declare CountAboveSalaries as Integet = 0

  7. 7. Declare CountBelowSalaries as Integer = 0

  8. 8. Declare I as Integer

  9. 9. For I = 0 to N-1 ***I do not recognize this statement from what is being taught in the book. Is This a For Loop? The syntax we use is like: For (I = 0; I < Count; Count++) Can you rewrite it using a For Loop or a While Loop?***


//prompt user to input employee name and salary



  1. a. Display “Enter employee name: ”

  2. b. Input Names

  3. c. Display “Enter employee salary: ”

  4. d. Input Salary


//calculate total salary



  1. e. TotalSalary = TotalSalary + Salary

  2. 10. Next i I do not recognize this statement either


//calculate average salary



  1. 11. Set AverageSalary = TotalSalary / N


//count salaries above and below the mean



  1. 12. For I = 0 to N-1*** Again, please use a for loop to count***

    1. a. If (Salary < AverageSalary) Then



i. Set CountBelowSalaries = CountBelowSalaries + 1



  1. b. Else


i. Set CountAboveSalaries = CountAboveSalaries+ 1



  1. c. End If

  2. 13. Next i ***?***


//display results



  1. 14. Display “Mean (Average) Salary: ”, AverageSalary

  2. 15. Display “Number of Salaries above mean: ”, CountAboveSalaries

  3. 16. Display “Number of Salaries below mean: ”, CountBelowSalaries


End



Thank you for your quick reply. I am learning that pseudocode can be written in different ways which can make it hard on you to write it the way it is done from one book to another. Below is an example of how the book I am studying loads an array:



Write "Enter a positive number or 0 to quit"


Input TempNum


While TempNum != 0


If TempNum < 0 Then


Write "You must enter a positive number, please try again"


Else


Set Num[Count] = TempNum


Set Count = Count + 1


End If


Write " Enter another number or enter 0 to quit"


Input TempNum


End While



Your way to code might be better, I do not know. I just want to be as consistent as possible.

I will review and reply ASAP.
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
LogicPro and 2 other Homework Specialists are ready to help you