Jump to content

Pls Help


kb24
 Share

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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...