system out print("enter your weight in kilograms")float weight nextfloat()float bmi weight/(height*height)* system out println("your body mass index is bmi ")when executedthis program could produce the following on the java consoleenter your height in centimeters: enter your weight in kilograms your body mass index is java util scanner methods the scanner class reads the input stream and divides it into tokenswhich are contiguous strings of characters separated by delimiterswhich are special separating characters the default delimiter is whitespacethat istokens are separated by strings of spacestabsand newlinesby default tokens can either be read immediately as strings or scanner object can convert token to base typeif the token is in the right syntax specificallythe scanner class includes the following methods for dealing with tokenshasnext()return true if and only if there is another token in the input stream next()return the next token string in the input streamgenerate an error if there are no more tokens left hasnexttype()return true if and only if there is another token in the input stream and it can be interpreted as the corresponding base typetypewhere type can be booleanbytedoublefloatintlongor short nexttype()return the next token in the input streamreturned as the base type corresponding to typegenerate an error if there are no more tokens left or if the next token cannot be interpreted as base type corresponding to type