Question: Exercise 1: 1. Write a method called cale that takes as parameter three integers. Use the following method header: public static void calc (int a,
Exercise 1: 1. Write a method called cale that takes as parameter three integers. Use the following method header: public static void calc (int a, int b, int op) If op is 1, it prints the difference of the two numbers If op is 2, it prints the result of the division of the two numbers Otherwise, it prints the following message: "bad choice" 2. Write a main method that asks the user to enter two integers. It then asks him to enter his option and calls the calc method by passing the three entered numbers as parameters, Sample run 1: Enter two integers 2 4 Enter your option (1 for -, 2 for 1 2-4--2 UR LA Sample run 2: Enter two Integers 3 5 Enter your option [1 for - 2 tor Bad choice Enter your option for 2 ton 5 Bad choice Enter your option for 2 for 2/4-05
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
