Question: 8) How many lexemes does the following Java code contain? 1. public class CountDigits { 2. public static void main(String[] args) { 3. SimpleIO.prompt(Enter an
8) How many lexemes does the following Java code contain? 1. public class CountDigits { 2. public static void main(String[] args) { 3. SimpleIO.prompt("Enter an integer: "); 4. String userInput = SimpleIO.readLine(); 5. int number = Integer.parseInt(userInput); 6. int numDigits = 0; 7. do{ 8. number += 10; 9. numDigits++; 10. } while (numDigits < 5) 11. System.out.println("The number " + userInput + " has " + 12. numDigits + " digits"); 13. } 14. } Give the number of lexemes on each line (using the line numbers shown) as well as the total number of lexemes.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
