Question: Question: Write a program that adds, subtracts, multiplies, and divides two numbers, 3, and 6. Below provided is a basic template for adding two numbers

Question: Write a program that adds, subtracts, multiplies, and divides two numbers, 3, and 6. Below provided is a basic template for adding two numbers to serve as a starting point. (This is in JAVA code). It was written in Notepad+, I am just typing it below to the best of my ability to match the format since it isn't letting me copy/paste.

1. public class Methods

2. {

3. public static void main (String[] args)

4. {

5. double a=3, b=6;

6. double total=0;

7. total = add(a,b);

8. System.out.PrintIn("The sum of numbers is : "+total);

9. }

10. public static double add(double x, double y)

11. {

12. return x+y:

13. }

14. }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!