Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

computer science Could you please tell me how many lexemes does the program cont

ID: 3562235 • Letter: C

Question

computer science

Could you please tell me how many lexemes does the program contain? The number of lexemes on each line.

1. import java.utils.*;

2. public class CountFlips {

3. public void static main(String args[]) {

4. String userInput;

5. int flips heads, tails = 0;

6. Scanner reader = new Scanner (System.in);

7. System.out.print("Enter number of flips: ");

8. flips = reader.nextInt();

9. for (i = 0; i < flips; i ++)

10. if ( Math.random() < 1/2)

11. head++;

12. else

13. ++tails;

14. System.out.println("Number of heads: " + heads + ' '

15. "Number of tails: " + tails);

16. }

17. }

Explanation / Answer

No. of lexemes in each line

1. 7
2. 4
3. 11
4. 3
5. 8
6. 11
7. 15
8. 8
9. 13
10. 12
11. 3
12. 1
13. 3
14. 19
15. 10
16. 1
17. 1