Help with Java. 100% Noob(Beginner)

Hey guys so I'm studying computer science and am currently taking a java course. I could really use some help with my project if there are any java experts out there. I'll show you my instructions and paste the code I have so far with what I'm struggling with. 


Project Requirements:

  1. Write a program that prompts the user for two numbers (double) and a power (another double) and then prints:
  1. The remainder after the first number is divided by the second number named public double remainder().
  2. The sum of the square of the two numbers (for example, 32 + 42) named public double sumOfSquares().
  3. The difference of the square of two numbers (must returns a positive number) named public double differenceOfSquares().
  4. The sum of the power of the two numbers (and power could be any number, for example, 3x + 4x , where x could be 5 or 6 or 7 or any other number) named public double sumOfPowers().
  5. The difference of the power of the two numbers (must returns a positive number) named public double differenceOfPowers().
  6. The square root of the first number plus the square root of the second number named public double sumOfSquareRoots().


2. Implement a class called Calc that represents two double values and a power. The Calc class should have an appropriate constructor that initializes a pair of values (the first two double values) and a power, and methods to return each result required in #1 above.

So you should implement a class called that has:

1. Three instance variables (two to hold the two numbers and one to hold the power) - make sure they are private and have accessors and mutators.

2. A default constructor. In the default constructor, set the first and second double values to zero and the power to one.

3. A parameterized constructor that creates and assigns the variables.

4. Six methods as described in requirement #1 the method must be named respectfully:

  1. public double remainder()
  2. public double sumOfSquares()
  3. public double differenceOfSquares()
  4. public double sumOfPowers()
  5. public double differenceOfPowers()
  6. public double sumOfSquareRoots()


  1. Implement a driver program called to test your Calc class. The driver program should prompt the user for three doubles (two for the numbers and one for the power), construct a Calc object, call the methods of the Calc class to compute the results, and then display them. Use the JOptionPane or Scanner (your choice) class to perform input.  Make sure you test both constructors.
  2. Use the JavaDoc utility to generate a web page document for your Calc class. Include comments for the class, instance variables, and all methods. In grading your project, we will generate the JavaDoc file from your file.

Here is the code I have written so far:

I'm having issues with my methods(I know how to make a basic calculator with addition subtraction etc... but I'm so confused with how to add a division method with remainder. I'm confused with all of them actually) and adding in the other constructor(I believe it's the parameterized constructor because I think the one i have is a default, though I have no clue)

Any help with be so appreciated! 

Math in Java is allot like algebra. (Kinda, its object oriented) But with Java there's no really good way to make it in one line. To divide two numbers use "/".

public int divide(int x, int y){ value = x / y; returns value; } (Returns x divided by y)

public int remainder(int x, int y){ value = x % y; returns value; } (Returns x divided by y's remainder)

More info here. 

 I'll check out that more info link. Really appreciate the help. I do have a question. For x and y should I put my variables that I used? (num1 num2) or do I simply just put x and y. Also I'm supposed to use public double remainder and so on for the other methods but you put public int. Just a tad confused with that.


"ints" are Integers (Whole numbers, No decimal). "doubles" are decimals, and "floats" are just doubles (I think)For the x and y, put the two numbers you want to divide, or find the remainder of. If you want it to return a double, just change the "int" part of the method to "double".