How many lexemes does the following Java code contain Give t

How many lexemes does the following Java code contain?

Give the number of lexemes on each line (using the line numbers shown) as well as the total number of lexemes.

1. public class CountDigits 2. public static void main (String .args) Simple IO. prompt \"Enter an integer String user Input SimpleIO. readLine int number Integer. parse Int (user Input) i num Digits int while (number 0) number 10; num Digits 0 System. out.println (\"The number userInput has 12. num Digits digits\") 13 14

Solution

lexemes are those words which contains a meaning in dictionary

1. lexemes(public, class)=2
2. lexemes(public, static, void, main, string)=5
3. lexemes(prompt, enter, an, integer)=4
4. lexemes(string)=1
5. lexemes(number, integer)=2
6. lexemes()=0
7. lexemes(while, number)=2
8. lexemes(number)=1
9. lexemes()=0
10. lexemes()=0
11. lexemes(system, out, the, number, has)=5
12. lexemes(digits)=1
13. lexemes()=0
14. lexemes()=0

Total=23

How many lexemes does the following Java code contain? Give the number of lexemes on each line (using the line numbers shown) as well as the total number of lex

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site