I'm in a beginning programming class and am having trouble with this question:
Write an application that gives you the product of odd integers from 3 to 35. Now change your program to allow a user to specify a range to calculate.
So far, I have-
package HMWK; //
import javax.swing.*;
public class HMWK {
public static void main( String args[] )
{
int product = 1;int num1; String input;
input= JOptionPane.showInputDialog ("Enter your number");
num1= Integer.parseInt(input);
for ( int x = 0; x <= 15; x += 2 )
product *= x;
JOptionPane.showMessageDialog( null, "Your product is " + product,
"Odd Product", JOptionPane.INFORMATION_MESSAGE );
System.exit( 0 );
}