Create a java project in eclipse

Assignment Help Computer Engineering
Reference no: EM132137104

Steps:

Create a Java project in Eclipse, called Lab 2. Next create a java class called Dashboard. It should extend javafx.application.Application. This will be the main GUI for your lab, and it should use a VBox as the root node.

The first element in the VBox should be a button with the text label "Go!".

The second element should be a text field where a user can enter the mean. By default, it should be 0.

The third element should be a text field where a user can enter the standard deviation. By default, it should be 10.

The fourth element should be a text field where a user can enter the number of data elements to randomly generate. Store these numbers that are generated in an ArrayList for later viewing.

In order to generate some data, you will need to use a NormalDistribution object for generating numbers:

NormalDistribution nDist = new NormalDistribution ( µ , s );

use: import org.apache.commons.math3.distribution.NormalDistribution;

With the distribution object, call the sample() function to generate a random number.

When the user clicks the "Go" button, your program should compute the following:

Maximum

Minimum

Mean (Average)

Weighted Average of the first 10 numbers: 10*list[0] + 9*list[1] ... / 55

Median

Standard Deviation (SD)

Figure 1 Prototype of GUI

After calculating the data, open a second Stage window with a layout for displaying the results from step 6. Also, the window should use a ListView for displaying the raw data from the ObservableList that the user can scroll through.

When you are finished, demonstrate your work to the lab professor. Click the "Go" button several times to generate several results sets to show that in small data sets, the Mean, Median and SD can vary. Then generate a large data set (N = 106) to show that larger sample sizes tend to converge to the true values:

With N = 100:

With N = 106:

To create a second stage, use:

Stage newStage = new Stage();

TextField tf = new TextField();

tf.setText(String.format("Mean: %f Max: %f Min:%f SD:%f Median:%f WeightedAverage:%f", mean, max, min, sd, median, weightedAverage));

Scene newScene = new Scene(tf, 500,100);

newStage.setScene(newScene);

.show();

The calculation of standard deviation is:

sd = Math.sqrt( differenceOfSquares( list, mean) / list.size() );// list are your numbers.

Write the differenceOfSquares( List<Double> list , double mean) as a function that iterates through every item and calculates the difference between it and the mean, squared:

double sum = 0;

list.forEach( item -> sum += (item - mean)*(item - mean) );

return sum;

To calculate the median, sort the list and get the middle element:

double median = list.get( list.size() / 2);// This is inefficient but works for now

Correctly calculating mean, max, min, median, weighted average, standard deviation: +6

GUI design:

Reference no: EM132137104

Questions Cloud

Calculate the items requested : Based on the data provided here, calculate the items requested:
What is static and dynamic binding : What is static and dynamic binding? Explain with example how you can implement dynamic binding.
Difference between earnings per share and pe ratio : What is the difference between Earnings per Share and P/E ratio? What do they measure?
What is the link utilization : Consider a TCP connection between two hosts that are 400 miles away from each other (propagation delay is 100 miles per msec.).
Create a java project in eclipse : Create a Java project in Eclipse, called Lab 2. Next create a java class called Dashboard.
Interest rates and arbitrage : The spot exchange rate is £.573, and the three-month forward rate is £.575. Ignoring transaction costs, in which country would the treasurer want to
What are the advantages of having a centralised database : HC1041 IT for Business Assignment, HOLMES INSTITUTE, Australia. What are the advantages of having a centralised database
Shares of cumulative preferred stock outstanding : Dia Lucrii, Inc. has 325,000 shares of cumulative preferred stock outstanding. The stock is supposed to pay $2.18 in dividends per share each quarter.
Shares of cumulative preferred stock outstanding : Dia Lucrii, Inc. has 325,000 shares of cumulative preferred stock outstanding. The stock is supposed to pay $2.18 in dividends per share each quarter.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Discuss why revising documentation is an important part

Discuss why revising documentation is an important part of change management. Discuss the importance of why system maintenance activities need to be approved.

  What is the difference between fec and arq

What is the minimum number of check bits required to detect and correct a single error in a data block of 256 bits?

  Write a program using plp tool

Write a program using PLP Tool (Progressive Learning Platform) in such that it repeatedly reads the value of the switches (address: 0xf0100000) .

  Write programs to generate a random text string

Write programs to generate a random 1000-bit text string, then find all occurrences of the last k bits elsewhere in the string, for lc= 5,10,15.

  Define the best possible scenario for an organization

If in a hypothetical situation your company was capable to hire only either technically sound managers with weak leadership skills OR strong leaders with less knowledge/interest in routine management, that would you opt for and why.

  Design and implement an upgraded version of the simple ftp

For the second part of the class project we will design and implement an upgraded version of the simple File Transfer Protocol from Part 1.

  Create a database to keep track of all the students

explain how you would design a database to keep track of all the students at a university. describe tables, relationships, attributes, Primary Keys, Foreign Keys, Candidate Keys. Describe minimum and maximum cardinalities for each relationship. Ma..

  Plot the magnitude response of the filter

The magnitude response of a digital filter with a real coefficient transfer function H(z) is shown in figure, plot the magnitude response of the filter H(z4).

  Define the loss of confidentiality and integrity

Write a report discussing security vulnerabilities that can lead to the loss of confidentiality, integrity, availability, authenticity, or accountability

  Why do companies need a technology roadmap

Why do companies need a technology roadmap? What utility to they bring to the organization? Who should be in charge of developing a technology roadmap?

  How an implementation phase works within the model

Writr a brief explanation of the Agile model and how an implementation phase works within the model. At least three technical design specifications for program.

  Sampling rate of the dia converter on computer system

For the chirp, the duration must be much longer than 50 ms, so the parameterµ must be adjusted to get a swept frequency range that passes through only a few.

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