I have this code that I'm producing...
I want to show the results as follows:
1) output to a .PDF & .TXT file. 2) Create a Bar Chart (in color) of the results.
Is this possible?
import javax.swing.JOptionPane;
public class TEXTTEXT_BarChart {
public static void main(String[] args) {
int numberOfStores = 5;
String userStringInput;
double storeSales;
int numberofHundredDollarDivisions;
String outputString = "SALES BAR CHART\n";
for (int store = 1; store <= numberOfStores; store++) {
userStringInput = JOptionPane.showInputDialog("Enter today's sales for store " + store);
storeSales = Double.parseDouble(userStringInput);
numberofHundredDollarDivisions = (int) (storeSales / 100);
outputString += "Store" + store + ": ";
for (int printAsterisk = 1; printAsterisk <= numberofHundredDollarDivisions; printAsterisk++) {
outputString += "*";
}
outputString += "\n";
}
JOptionPane.showMessageDialog(null, outputString);
System.exit(0);
}
}