Jump to content

Recommended Posts

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 by KB24
Link to post
Share on other sites
  • 2 weeks later...

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(); }}

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...