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

  Design the decoding circuitry

Arrange the 16 chips needed in the design of Problem (b) as a 4 x 4 array and design the decoding circuitry.

  Security and privacy issues in cloud computing

Identify any important issue/s that you believe were not addressed, or not addressed adequately in the discussions. Discuss why you view this issue/these issues as important - Discuss the impact of the above mentioned issues and their application/i..

  Choose one of the ubuntu shells and discuss how you can

choose one of the ubuntu shells and discuss how you can perform a minimum of 20 commands or functions. these commands

  State and explain in brief moores law

State and explain in brief Moore's law. justify this empirical law in brief, arguing on the basis of development of newer VLSI fabrication technology.

  What are the characteristics of the imperative paradigm

What are the characteristics of the imperative paradigm? What are the characteristics of the functional paradigm? What are characteristics of logic paradigm?

  Describing the views

Explain why do you think that views by themselves are insufficient in order to protect the access by the unauthorized users?

  Program to experiment various sort algorithms

Develop a program which enables you to experiment along with the various sort algorithms. This program must allow you to easily plug-in the new sort algorithms and provide comparison between them.

  How you can use this mechanism to distribute a symmetric key

Public key cryptography is more suitable for key distribution than bulk data encryption. Explain how you can use this mechanism to distribute a symmetric key.

  You work for a regional forensic computer lab and have been

you work for a regional forensic computer lab and have been tasked with recovering all data from a suspects cellular

  Use a bubble sort algorithm in c++

use a Bubble Sort algorithm in C++ that generates a list of 10 random integers.

  Show how we can use second-best map inference

Show how we can use second-best MAP inference to either find a violated constraint or guarantee that all constraints are satisfied.

  How you explored the command on your linux system

A valid screenshot with appropriate figure number and caption showing how you explored the command on your Linux system.

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