[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 519
  • Last Modified:

Need help making sum, difference, product, average in java using eclispe

hello Need help making sum, difference, product, average in java using eclispe i want to make this work in my program i only need two integers and have it display it sum, difference, product, and average how do you build it to do that.
0
seanf85
Asked:
seanf85
  • 2
1 Solution
 
JonasLedelCommented:
If you just want to use two integers and not an array you just do the mathematical calculations on your integers:
sum = integerOne + integerTwo;
difference = integerOne - integerTwo;
product = integerOne * integerTwo;
average = (integerOne + integerTwo) / 2;

Or do you want to put an array with integer values into a function that calculates the sum, difference, product and average?
0
 
seanf85Author Commented:
what is the code for the array with integer values into a fuction that calculates the sum, difference, product and averge iam kinda of new to java my main problem iam getting these codes errors with the JOption is this due to the program not finding the right path also just want to ask how would i start this program out with the code you gave me. can you please me me example like the class main_class {
 java.lang.NoClassDefFoundError: my_kidprogram_Fernandez
Caused by: java.lang.ClassNotFoundException: my_kidprogram_Fernandez
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"
0
 
seanf85Author Commented:
thanks for the help it worked
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now