Answer:
The complete program is:
import java.util.Scanner;
class Main
{
public static void main (String [] args) {
int numObjects;
Scanner scnr = new Scanner(System.in);
numObjects = scnr.nextInt(); // Program will be tested with values: 15, 40.
System.out.println(numObjects);
}
}
Explanation:
The program is as mentioned above, And we can check with inputs 15, and 40. And it was found that correct answer is obtained on running the program.
Answer:
public class Main
{
public static void main(String[] args) {
Main m=new Main();
System.out.println(m.mymath(true,5,2)); // calling the function mymath
}
public int mymath(boolean a,int b,int c) // mymath function definition
{
if(a==true)
{
int d=b+c;
return d;
}
else{int e=b-c;
return e;
}
}
}
Well I got some numbers mixed up but I think it’s B
Sanscript i think idk i need points