Question

In: Computer Science

Diana Lee, a supervisor in a manufacturing company, wants to know which employees have increased their...

Diana Lee, a supervisor in a manufacturing company, wants to know which employees have increased their production this year over last year so that she can issue them certificates of commendation and bonuses. Design a flowchart or pseudocode for the following:
a. A program that continuously accepts each worker’s first and last names, this year’s number of units produced, and last year’s number of units produced. Display each employee’s data with a message indicating whether the employee’s production has increased over last year’s production.

b. A program that accepts each worker’s data and displays the employee name and a bonus amount. The bonuses will be distributed as follows:
If this year’s production is greater than last year’s production and this year’s production is:

    1000 units or fewer, the bonus is $25
    1001 to 3000 units, the bonus is $50
    3001 to 6000 units, the bonus is $100
    6001 units and up, the bonus is $200

c. Modify Exercise 9b to reflect the following new facts, and have the program execute as efficiently as possible:

    Thirty percent of employees have greater production this year than last year.
    Sixty percent of employees produce over 6000 units per year; 20 percent produce 3001 to 6000 units; 15 percent produce 1001 to 3000 units; and only 5 percent produce fewer than 1001 unit

Solutions

Expert Solution

a.

Start

Declare fname as string, lname as string
Declare yearunits as integer, lastyearunits as integer
Declare terminate as string
Let terminate=""

While terminate != "n" do

Print "Enter first name"
Read fname
Print "Enter last name"
Read lName
Print "Enter this year units produced"
Read yearunits
Print "Enter last year units produced"
Read lastyearunits
  
if yearsunits>lastyearunits Then
Print "Employee's production has increased over last year"
Else yearsunits<lastyearunits Then
Print "Employee's production has decreased over last year"
Else
Print "Employee's production is same as last year"
End If
  
Print "Want to continue ? Press y to continue or n to exit"
Read terminate

End While

Stop

b.

Start

Declare fname as string, lname as string, bonus as string
Declare yearunits as integer, lastyearunits as integer
Declare terminate as string
Let terminate=""

While terminate != "n" do
  
Print "Enter first name"
Read fname
Print "Enter the last name"
Read lname
Print "Enter this year units produced"
Read yearsunits
Print "Enter last year units produced"
Read lastyearunits
Let bonus=0

if yearunits>lastyearunits Then
if yearunits<=1000 Then
set bonus="$25"
else if yearunits>1000 and yearunits<=3000 Then
set bonus="$50"
else if yearunits>3000 and yearunits<=6000 Then
set bonus="$100"
else if yearunits>6000 Then
set bonus="$200"
End IF
Print "The employee " + fname + " " +lname + " has got bonus of "+ bonus
Else
Print "The employee " + fname + " " +lname + " has not got bonus "
End If

Print "Want to continue ? Press y to continue or n to exit"
Read terminateProgram

End While

Stop

c.

Start

Declare fname as string, lname as string, bonus as string
Declare yearunits as integer, lastyearunits as integer
Declare terminate as string
Let terminate=""
Declare pgproductionas double
Declare avg6unit as double, avg3to6 as double, avgless1001 as double, avgmorethanlast as double
Declare int6unit as integer, int3to6 as integer, intless1001 as integer
Let int6unit=0
Let int3to6=0
Let intless1001=0
Declare avgtwoYrProd as double
Declare intmorethanlast as integer, totalemp as integer
Let intmorethanlast =0
Let totalemp =0
  
While terminateProgram != "n" do
  
Print "Enter the first name"
Read fname
Print "Enter the last name"
Read lname
Print "Enter this year units produced"
Read yearunits
Print "Enter last year units produced"
Read lastyearunits
Let bonus=0
Set avgtwoYrProd=(yearunits+lastyearunits)/2
  
if avgtwoYrProd<=1000 Then
Set intless1001=intless1001 + 1
else if avgtwoYrProd>3000 and avgtwoYrProd<=6000 Then
Set int3to6=int3to6 + 1
else if avgtwoYrProd>6000 Then
Set int6unit=int6unit + 1
End IF

if yearunits>lastyearunits Then
Print "Employee's production has increased over last year"
set intmorethanlast = intmorethanlast +1
if yearunits<=1000 Then
set bonus="$25"
else if yearunits>1000 and yearunits<=3000 Then
set bonus="$50"
else if yearunits>3000 and yearunits<=6000 Then
set bonus="$100"
else if yearunits>6000 Then
set bonus="$200"
End IF
Print "The employee " + fname + " " +lname + " has got bonus of "+ bonus
Else
Print "The employee " + fname + " " +lname + " has not got any bonus "
End If

Set totalemp= totalemp+1

Print "Want to continue ? Press y to continue or n to exit"
Read terminate

End While
  
set avgmorethanlast=(intmorethanlast/totalemp) * 100
Print avgmorethanlast +" percent of the employees have greater production this year than last year. "
Set avg6unit=(int6unit/totalemp) * 100
Print avg6unit +" percent of employees produce over 6000 units per year "
Set avg3to6=(int3to6/totalemp) * 100
Print avg3to6 +" percent produce 3001 to 6000 "
Set avgless1001=(intless1001/totalemp) * 100
Print avgless1001 +" percent produce fewer than 1001 "

Stop


Related Solutions

Randi wants to know if at least 90% of the employees at her company are currently...
Randi wants to know if at least 90% of the employees at her company are currently enrolled in a health insurance plan. She randomly samples 700 employees and finds that 651 of them are currently enrolled in a plan. Randi conducts a one-proportion hypothesis test at the 5% significance level, to test whether the true proportion of employees enrolled in a plan at this company is greater than 90%. For this test: H0:p=0.9; Ha:p>0.9, which is a right-tailed test. Use...
In 2004 David Lee started Lee Manufacturing, a company dedicated to manufacturing simple yet efficient gas...
In 2004 David Lee started Lee Manufacturing, a company dedicated to manufacturing simple yet efficient gas barbecues. The barbecues are made of aluminum and stainless steel and are priced at the middle of the market. David’s goal has always been to make a barbecue that cooks great food. This means, good quality parts, simple construction, even heat, no hot or cold spots, and a barbecue that will hold temperature from the lowest setting to the highest setting. David’s motto is...
John is a new supervisor concerned with having effective communications with his employees and wants to...
John is a new supervisor concerned with having effective communications with his employees and wants to try to minimize the barriers that gein the way of understanding. When communicating with them, John should be aware of .....barriers.
Diana Mark is the president of ServicePro, Inc., a company that provides temporary employees for not-for-profit...
Diana Mark is the president of ServicePro, Inc., a company that provides temporary employees for not-for-profit companies. ServicePro has been operating for five years; its revenues are increasing with each passing year. You have been hired to help Diana in analyzing the following transactions for the first two weeks of April: April 2 Purchased and received office supplies for $1,400 on account. April 5 Billed the local United Way office $6,600 for temporary services provided. April 8 Paid $430 for...
The manufacturing supervisor of Clay Stone Manufacturing Company has provided you with the details of manufacturing...
The manufacturing supervisor of Clay Stone Manufacturing Company has provided you with the details of manufacturing cost related to three processes - mixing, drying, and painting. The product of a company passes through three distinct processes to completion. 12,000 units have been issued to process mixing. The output of each process: Mixing:11,000 units Drying: 10,000 units Painting: 9,000 units. The normal loss incurred in each process is as follows: Mixing is 6% and the scrap value is RO 12 per...
A company wants to reward key employees and is considering a restricted stock plan. They have...
A company wants to reward key employees and is considering a restricted stock plan. They have asked you for advice on whether there is an advantage to offering restricted stock units instead of a restricted stock award. What happens if you are fired, retire or die prior to the end of the vesting period?
A market analyst wants to know if the new website he designed is showing increased page...
A market analyst wants to know if the new website he designed is showing increased page views per visit. A customer is randomly sent to one of two different​ websites, offering the same​ products, but with different designs. Assume that the data come from a distribution that is Normally distributed. The data is shown in the table to the right. Complete parts a through c below. Website 1 Website 2 n 80 95 ybar 6.5 6.3 s 4.9 5.4 Calculate...
A market analyst wants to know if the new website he designed is showing increased page...
A market analyst wants to know if the new website he designed is showing increased page views per visit. A customer is randomly sent to one of two different​ websites, offering the same​ products, but with different designs. The accompanying table shows the data from five randomly chosen customers from each website. Assume that the data come from a distribution that is Normally distributed. Complete parts a through c below. Website 1 Website 2 11 8 6 12 14 4...
NPI is a health research and manufacturing company which recently discovered that increased sulforaphane( at least...
NPI is a health research and manufacturing company which recently discovered that increased sulforaphane( at least 5,000 mg every 2 days) in a persons diet has been able to extend a persons life span by at least 30 years. The company developed a new product called "Sustain Your Life" which is a small tablet that contains 5,000 mg of sulforaphane in each tablet. The health tablet market size is currently measured at 150 million units(15 tablets per bottle) of which...
NPI is a health research and manufacturing company which recently discovered that increased sulforaphane( at least...
NPI is a health research and manufacturing company which recently discovered that increased sulforaphane( at least 5,000 mg every 2 days) in a persons diet has been able to extend a persons life span by at least 30 years. The company developed a new product called "Sustain Your Life" which is a small tablet that contains 5,000 mg of sulforaphane in each tablet. The health tablet market size is currently measured at 150 million units(15 tablets per bottle) of which...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT