Home /
Expert Answers /
Computer Science /
4-6-2-jump-to-level-1-given-double-massgrams-if-the-mass-is-heavier-than-15-1-grams-and-lighter-tha-pa408
(Solved): 4.6.2 Jump to level 1 Given double massGrams, if the mass is heavier than 15.1 grams and lighter tha ...
4.6.2
Jump to level 1 Given double massGrams, if the mass is heavier than 15.1 grams and lighter than 95.2 grams, output 'Admit'. Otherwise, output "Decline', End each output witha newline. Exi if the input is 93.15 , then the output is: Admit 1 inport Jova.uti1. Scanner: 2 3 public class MassController \{ public static void main (String[ args) \& Scanner scnr = new Scanner(System, in); double massGroms; massGrams = scnr. nextDouble(); Y * Your code goes here % 11 13 \}
Certainly! Here's a detailed explanation of each step in the code:Import the required Scanner class from java. util package.This statement ensures that the Scanner class is available for use in the code.2. Define the Mass-controller class that contains the main method.The MassController class is the entry point of the program. It contains the main method where the execution of the program begins.