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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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