The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 407 Weeks Ago, 5 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Computer Science, Java Eclipse basic. I almost complete, but I got lost in one part. How do I add the result of frequency to my code to show into my dialogue box?
//Template #2
package intPak;
import java.text.NumberFormat;
import java.util.Locale;
import java.util.Random;
import javax.swing.JOptionPane;
import javax.swing.JTextArea;
public class Interest {
private int dime;
private JTextArea outputTextArea;
int value;
//constructor
Interest() {
}
public void startApp(){
int iterations = 6000;
int[] faceValues = new int[2];
int value; Random r = new Random();
String results = "";
outputTextArea = new JTextArea();
outputTextArea.setText("Face\tFrequency\n");
for (int i= 1; i <= 6; i++) {
this.value = 1+r.nextInt(6);
outputTextArea.append(i + "\t" + results + "\n"); } JOptionPane.showMessageDialog(null, outputTextArea, "Compound Interest", JOptionPane.INFORMATION_MESSAGE);
}
public static void main(String[] args) {
Interest obj = new Interest();
obj.startApp();
}
}
//Template #2 end
My answer on dialogue box contains only Face 1,2,3,4,5,6...can someone help me to include the Frequency result values? thank you
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------