Question: need to write the java code requested in the comments. public class MathFun { //Insert all code by adding a line IMMEDIATELY below the comment
public class MathFun { //Insert all code by adding a line IMMEDIATELY below the comment describing what to do //Declare two integers, a and b public void init() { //Put the value 3 into variable a //Put the value 5 into variable b public void results() { //Declare an integer called sum //Declare an integer called prod //Declare an integer called diff //Declare an integer called remain //set sum as the sum of a and b //set prod as the product of a and b //set diff as b subtracted by a //set remain as the remainder of b divided by 2 public void newResults() { //Declare an integer called twice //Declare a decimal variable called ave //Declare an integer called whoa //set twice to a doubled //set ave to the average of a and b. //set whoa to ten times a plus b Make sure the answer is a decimal value public static void main(String[] args) { //this.init(); //this.results(); //this.newResults ()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
