Calculate and display the average employee salary

Assignment Help Other Subject
Reference no: EM133137652 , Length: word count:2000

COIT20256 Data Structures and Algorithms - Central Queensland University

Question 1. Assuming that random is a SecureRandom object, explain in detail the stream pipeline:

random.ints(1000000, 1, 3)
.boxed()
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()))
.forEach((side, frequency) ->
System.out.printf("%-6d%d%n", side, frequency));

Question 2. Reimplement the following statement using a lambda as the event handler:

1. slider.valueProperty().addListener(
2. new ChangeListener<Number>() {
3. @Override
4. public void changed(ObservableValue<? extends Number> ov,
5. Number oldValue, Number newValue) {
6. System.out.printf("The slider's new value is %s%n", newValue);
7. }
8. }
9. );

Activity One
Implement the program designed as part of Activity One in Lecture. The question is repeated here.

Question 3. Write a java program to generate twenty five random integers between 0 and 100 (inclusive), display the values, display the sorted values, sum and average of the values. Display the list of values greater than 50. Use Lambdas.
Activity Two

Question 4. Write a stream operation to calculate and display the average employee salary by department. (Use the source code in Fig.17.20 from the Example source files used in lecture, available at the Unit Website, Week 8 Folder.

Question 5. What is wrong with the following stream pipeline?
1 list.stream()
2 filter(value -> value % 2 != 0)
3 sum()
Write the correct stream pipeline.

Question 6. Write a java program to:
a) Display the original string values in the array
b) Display the string values converted to uppercase
c) Display the string values in ascending order after filtering the values starting with g or less
d) Display the string values in descending order after filtering the values starting with g or less.
Data: String [] names = {"bob", "Mary" "Andrew", "Tomy", "Michael", "Kathy", "lily", "Frances"}

Question 7. Use the class Invoice provided at the unit website in Week 8 folder. Use the sample data shown below. Perform the following queries on the array of Invoice Objects and display the results:

a) Use lambdas and streams to sort the Invoice objects by Price, then display the results.
b) Use lambdas and streams to map each Invoice to its PartDescription and Qunatity, sort the results by Quantity, and display the results.
c) Use lambdas and streams to map each Invoice to its PartDescription and the value of the Invoice (i.e., Quantity * Price). Order the results by Invoice value.
d) Modify Part (d) to select the Invoice values in the range $200 to $500. (Reference: Textbook Chapter 17,Exercise 17.11)

Attachment:- Data Structures and Algorithms.rar

Reference no: EM133137652

Questions Cloud

Value of training in strategic contemporary hrm : Your Agency Head has been ordered by the Governor to trim the budget. The Agency Head consults you about possible cuts in the area of training.
Americans are at increased risk for bone fractures : The Department of Health and Human Services (2021), estimates that 53 million Americans are at increased risk for bone fractures
Calculate the warranty payable at the end : The estimated warranty payable balance was $99 000 in 2017. Calculate the warranty payable at the end of 2018 and show the Journal entry
Sarcopenia is normal age-related process of muscle fiber : Sarcopenia is the normal age-related process of muscle fiber loss. Type I muscle fibers support endurance and posture.
Calculate and display the average employee salary : Write a stream operation to calculate and display the average employee salary by department
Making training a competition at sonic : For more than 60 years, Sonic has been America's Drive-In. With over 3500 locations, it is also the largest chain of drive-in restaurants in America.
What is net present value of this project : A proposed 10-year project is anticipated to cost $165,000. Assuming a firm's cost of capital is 11% per annum, what is net present value of this project
Ethical issues for internal and external consultants : 1. What are some ethical issues for internal and external consultants?
Explains five deficiencies in the sales system : As the external auditor of Habib Co, report to management in respect of the sales system described above which: Explains FIVE deficiencies in the sales system

Reviews

Write a Review

Other Subject Questions & Answers

  Do a search for articles on vaccination and autism

Do a search for articles on vaccination and autism. Find 3 quality articles... use APA 6 to build a bibliography of the 3 articles

  Discuss historical development of communication technologies

Discuss the historical development of communication technologies and explain any pros and/or cons of these technological advances.

  Discuss cultural beliefs and biases identified in the map

Describe the relationship between the cultural beliefs and biases identified in the map and the social issue, and provide specific examples

  What type of disciplinary actions would you take

Do you consider Newton a problem employee or would you consider this a problem situation? Explain your response. What type of disciplinary actions, if any, would you take against Newton

  Under the job family of education-training and library

Using the O*Net, find the occupational profile for a university professor teaching psychology. (Hint: It should be under the job family of education, training, and library, and reads as psychology teachers, postsecondary.) 2. With the information ..

  Examine how much assault against men is occurring australia

Examine how much assault against men is occurring in Australia. Finally, apply two criminology theories as to why men assault other men

  Describe main components of operational security

For this essay, you will explain the five main components of operational security (OPSEC), and you will discuss how OPSEC, personal security (PERSEC).

  Discussion about the scott v sandford decision

Do you think it was necessary for the Scott v. Sandford decision to be overturned by the passage of the 14th Amendment rather than a Supreme Court decision?

  Discuss about the alpha level

The alpha level tells us how likely we are to reject the null hypothesis when it is in fact true (false positive).

  Made to plan for as many terrorist events

How can efforts can be made to plan for as many terrorist events as possible while remaining flexible enough to adapt to changing terror events

  What is opportunistic fundraising

Explain the concept of Canvassing and how it can help an organization. What is opportunistic fundraising?

  Explain the impact on the price of the product

With these economic indicators in mind, how has the economy affected the demand for and supply of your selected product over the last 2 years?What was the impact on the supply of the product and the impact on the demand for the product?Explain the ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd