kb24 Posted May 21, 2009 Posted May 21, 2009 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?
inktherapy Posted June 4, 2009 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(); }}
Recommended Posts
Archived
This topic is now archived and is closed to further replies.