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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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