Let's say I have a 2-d array of doubles of 3 rows and 5 columns named sales
double [][] sales = new double [3][5];
How do i add a value to a specific row and column, or cell? I am trying to write...
Type: Posts; User: JohnEliot
Let's say I have a 2-d array of doubles of 3 rows and 5 columns named sales
double [][] sales = new double [3][5];
How do i add a value to a specific row and column, or cell? I am trying to write...
The if statement is not a loop. In only needs {} if it is a loop, no?
In the very last method below
import javax.swing.JOptionPane;
public class program08 {
public static void main(String[] args) {
String getWeightString = JOptionPane.showInputDialog(null,...
Okay, I have made some indentations at key points and just including the final loop. This is the part I want fixed.
String reply = JOptionPane.showInputDialog
(null, "Enter 'E' to buy...
Okay I have enclosed the loop, but it still won't repeat when yes is selected. I have also attempted to make the program more readable with indentations
import javax.swing.JOptionPane;
public...
import javax.swing.JOptionPane;
public class program7 {
public static void main(String[] args) {
//ask user how many euros a dollar buys
String euroExchangeRateString =...
import javax.swing.JOptionPane;
public class program7 {
public static void main(String[] args) {
//ask user how many euros a dollar buys
String euroExchangeRateString =...
I know how to print using the printf method, but can't for the life of me get it to round to two decimal places using a dialog box.
import javax.swing.JOptionPane;
public class Program6 {
...
How do I make a non-numeric letter represent an integer value? It can only be "Y" "N" or "Q"
Here it is:
Exception in thread "main" java.lang.NumberFormatException: For input string: "y"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at...
It is a loop program that counts Yes votes with 'Y', no votes with "N" and to quit is "Q" and after quit is chosen it shows number of yes votes and number of no votes, all in a dialog box. Here it...