Home /
Expert Answers /
Computer Science /
in-java-first-write-code-that-uses-scnr-nextint0-to-read-in-a-value-for-variable-nummushrooms-from-pa783
(Solved): In java First, write code that uses scnr nextint0 to read in a value for variable numMushrooms from ...
In java
First, write code that uses scnr nextint0 to read in a value for variable numMushrooms from input: Then, write code that uses System out.printin 0 to output the variable numMushrooms, followed by " mushrooms" Ex: If the input is 8 , then the output is: 8 mushrooms Ex: If the input is 9, then the output is: 9 mushrooms Note: - Our autograder automatically runs your program several times, testing different input values each time to ensure your program works for any values. This program is tested three times: first with the input 8 , then with the input 9 , and finally with a random input. - You can only edit lines where the line number (shown on the left) are white. Lines with grey line numbers cannot be edited. 1 import java.util. Scanner; 2. 3 public class Mushrooms \{ public static void main(String D args) \{ Scanner senr = new Scanner(System, in); int numMushrooms; Your code goes here * - scnr, nextInt(); System,out.println(/* Your code goes here "); \}