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
Get step-by-step solutions from verified subject matter experts
