import javax.swing.JOptionPane; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package IntegerOperationsAssignment; /** * * @author */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { String positiveInteger1; positiveInteger1 = JOptionPane.showInputDialog(null,"Please enter a positive integer","Number1"); String positiveInteger2; positiveInteger2 = JOptionPane.showInputDialog(null,"Please enter a positive integer","Number2"); Double positiveInteger11; positiveInteger11 = Double.parseDouble(positiveInteger1); Double positiveInteger22; positiveInteger22 = Double.parseDouble(positiveInteger2); Double divisionInt1; divisionInt1 = positiveInteger11/positiveInteger22; Double divisionInt1Remainder; divisionInt1Remainder = positiveInteger11%positiveInteger22; Double answerRound; answerRound = Math.round(divisionInt1*100)/100.00; int integerNum; integerNum = Integer.parseInt(positiveInteger1); Double decPartOnly; decPartOnly = (divisionInt1 - integerNum); Double integer1Square; integer1Square = Math.sqrt(positiveInteger11); Double squareRound; squareRound = Math.round(positiveInteger22*Math.pow(10,positiveInteger22))/Math.pow(10,positiveInteger22); JOptionPane.showMessageDialog(null,"NUMBER 1: " + positiveInteger11 + "NUMBER 2:" + positiveInteger22 + "\n" + "When" + positiveInteger11 + "is divided by" + positiveInteger22 + "the answer is" + divisionInt1 + "with a remainder of" + divisionInt1Remainder + "\n" + "When" + positiveInteger11 + "is divided by" + positiveInteger22 + "the integer part is" + divisionInt1 + "and the decimal part is" + decPartOnly + "\n" + positiveInteger11 + "divided by" + positiveInteger22 + ",rounded to 2 decimal places is" + answerRound + "\n" + "The square root of" + positiveInteger11 + ", rounded to 2 decimal places is" + answerRound + "\n" + "The square root of," + positiveInteger11 + "rounded to" + positiveInteger22 + "decimal places is" + squareRound); } }
The only error the netbeans IDE it is giving me is when I type this: import javax.swing.JOptionPane;
and this: package IntegerOperationsAssignment;
it's underlining with red the "i" in import and it's underlining everything in the package thing.
How do I fix this?