kb24 0 Posted May 21, 2009 Report Share Posted May 21, 2009 (edited) Use the 6 steps to create a program that uses 2 Dialog boxes to prompt the user for 2 integers then print:• The sum• The difference(take the second number from the first)• The product• Raise the first number to the power of the second using Maths.pow methodMind post me the coding? Edited May 21, 2009 by KB24 Quote Link to post Share on other sites
inktherapy 0 Posted June 4, 2009 Report Share Posted June 4, 2009 I will just give a rough coding, you've got to earn it though.public class MyClass { // Constructor public MyClass(int x, int y) { int x; int y; }// methods public int getSum (int x, int y) { // method goes here return z; } public void addSum () { // method goes here return z; } public void addPower() { } etc... public static void main(String[] args) { int dialog1 = JDialog.showInputDialog(null; "Type here"); int dialog2 = JDialog.showInputDialog(null; "Type here"); MyClass xt = new MyClass (dialog1, dialog2); methodAdd(); ... methodRaise(); }} Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.