Convert Project #1 into a GUI program, following the following requirements:
Feel free to augment the program further, if you have time. Recommended are playing with mouse events and nesting components (panels).
Please upload your source code to this assessment. Please name your file as follows:
CS401Recitation10SC_YOURLASTNAME_YOURLOGINID.java [please put all source code in one file -- all class/interface/method definitions, and the actual application]
For reference, Project #1: For this project, you are tasked with creating a program that performs basic numerical analysis on a sequence of integer numbers inputted into your program. Ask the end user for a number, which indicates the length of the sequence (how many numbers are in the data set to be inputted by the end user and analyzed by your program). Then, ask the end user to enter each integer number via the keyboard, one at a time, that comprises the sequence. Do not store each number in memory - perform the computations as the data is entered. Compute the average of the sequence, the summation of all numbers in the sequence, the minimum number in the sequence, and the maximum number in the sequence. Print your data statistics out to the end user via monitor output.
please help ASAP!!! - I just need a general structure would help me get started!!!! - I don't need the entire code :)
Answer:
1. Design the Interface as per the question ( as below )

2. Code for Calculate Button for calculating Sum ( Coded only to calculate Sum )
(Paste inside the click event of the button)
----------------------------START------------------------------------------------------------------------
private void
btnCalculate_Click(Object sender,
tangible.EventArgs e)
{
int seqFromUser
= CharCountWithoutComma(txtSequence.Text);
if
(Integer.parseInt(txtSequenceLength.Text.toString()) ==
seqFromUser)
{
if (rbSum.Checked == true)
{
if
(!txtSequence.Text.endsWith(","))
{
int
sumOfSequence = Sum(txtSequence.Text.trim());
JOptionPane.showMessageDialog("The sum of the Sequence: " +
String.valueOf(sumOfSequence), "Sum");
}
else
{
JOptionPane.showMessageDialog("Remove comma at the end of the
sequence and proceed", "Incorrect Sequence");
}
}
}
else
{
JOptionPane.showMessageDialog("The sequence
length is not matching", "Error");
}
}
public final int
CharCountWithoutComma(String str)
{
String[] arr =
str.split("[,]", -1);
String allChars
= "";
for (String s :
arr)
{
allChars += s;
}
int length =
allChars.length();
return
length;
}
public int Sum(string sumNumbers)
{
string[] arr = sumNumbers.Split(',');
int sum = 0;
foreach (string s in arr)
{
sum += Convert.ToInt32(s);
}
return sum;
}
----------------------------START------------------------------------------------------------------------
Code Explanation to find SUM
----------------------------
1. CharCountWithoutComma function will calculate the length of the sequence entered by the user
2. Checking whether the "length of the sequence == the actual sequence length"
3. Also, checking the sequence should not contain any comma at the end (eg: 1,4,6,) to avoid parsing error
(Point 2 & 3 are some additional checking from my side to enhance the program)
4. If all the conditions ok, the sum function will calculate the sum of the sequence.
Output
-----------
Catching Incorrect Sequence Length


Catching comma at the end of the sequence

Calculating Sum

Code to Clear text fields
----------------------------------
--------------------------------------------START--------------------------------------------------------------
private void btnClear_Click(Object
sender, tangible.EventArgs e)
{
txtSequenceLength.Text = "";
txtSequence.Text
= "";
}
------------------------------------------------------------END--------------------------------------------------------------
Please Note:
1. I coded only for the SUM function.
2. Just modify the "Sum" to calculate the other like Average, Min, Max (Small change is required)
3. Use NetBeans
----------------------------------------------ALL THE BEST-------------------------------------------------------------------
Convert Project #1 into a GUI program, following the following requirements: Provide two text fields: one...
Hi, I need help with this Java GUI program. The instruction and code can be found below thanks. This GUI is the start of a simple number entry GUI class. The program displays four Buttons and every time the user clicks on a button, the corresponding button label appears on the bottom of the GUI. As a hint, you might break up the design of the GUI into two parts: one part holds the buttons, the other holds the completed...
Instructions: Add radio button options for filing status to the tax calculator program of Project 1. The user selects one of these options to determine the tax rate. The Single option’s rate is 20%. The Married option is 15%. The Divorced option is 10%. The default option is Single. Be sure to use the field names provided in the comments in your starter code. Given Code: It also gives us the code for a module but that is like 3000...
please write JAVA code: Your Own Exception Class Write a text-based (non-GUI) program to read in file that contains only positive numbers and outputs to the screen the sum of all numbers. Create your own exception class that describes the situation of a non-positive number. In your program, use this exception to handle this situation. Use other exception classes from the Java standard library to handle other I/O situations.
JAVA Create a simple Graphical User Interface (GUI) in java with the following requirements: The interface components will appear centered in the interface, and in two rows. o Row one will have a Label that reads “Please enter a valid integer:” and a Text Field to take in the integer from the user. o Row two will have a Button that when pressed converts the integer to binary The conversion will be completed using recursion – A separate...
Programming Exercise 8.3 | Instructions Write a GUI-based program that allows the user to convert temperature values between degrees Fahrenheit and degrees Celsius. The interface should have labeled entry fields for these two values. breezypythongui.py temperatureconvert... + 1 2 File: temperatureconverter.py 3 Project 8.3 4 Temperature conversion between Fahrenheit and Celsius. 5 Illustrates the use of numeric data fields. 6 • These components should be arranged in a grid where the labels occupy the first row and the corresponding fields...
CSC151 Stock Portfolio GUI Project
Goal
You are to write a GUI program that will allow a user to
buy, sell and view stocks in a stock portfolio. This document will
describe the minimum expected functions for a grade of 90. Your
mission is to “go and do better.” You’ll find a list of enhancement
options at the end of this document.
Objectives
By the end of this project, the student will be able to
• write a GUI program...
Phonebook This program is used to create a phonebook for storing contact information into a text file. The program begins by asking the user to provide a name for the file that will contain their phone book information. It will then ask the user to provide the names and numbers of their contacts. It should keep asking the user for contact information until they type in Done (case-sensitive). After the user types Done, store all contact information into the file...
The JavaFX framework provides more than one way to handle events. For event handlers, we could use inner classes, anonymous inner classes, or the new Java 8 feature of lambda expressions. In this discussion, you will explore these different ways of writing event handles in JavaFX. To prepare for this discussion, you must unzip the attached NetBeans project zip file (U4D1_HandleEvents.zip) and load it into your NetBeans IDE. The project uses an inner class to handle the click event on...
Project overview: Create a java graphics program that displays an order menu and bill from a Sandwich shop, or any other establishment you prefer. In this program the design is left up to the programmer however good object oriented design is required. Below are two images that should be used to assist in development of your program. Items are selected on the Order Calculator and the Message window that displays the Subtotal, Tax and Total is displayed when the Calculate...
Please design a Java GUI application with two JTextField for user to enter the first name and last name. Add two JButtons with action events so when user click on one button to generate a full name message from the user input and put it in a third JTextField which is not editable; and click on the other button to clear all three JTextField boxes. Please run the attached nameFrame.class file (Note: because there is an actionhandler inner class in...