1

How many lexemes does the following Java code contain? public class RectArea { public static double...

Question

How many lexemes does the following Java code contain? public class RectArea { public static double...

1. How many lexemes does the following Java code contain? 1. public class RectArea f 2. public static double area(double length, double width) f 3. 4 double area 0.0; try f area width*height; = catch (Exception e) f System.out.println(Error in RectArea.area: + 7. 8. 9 10. e.getMessage)); System.exit (1); return area; 12. 13. Give the number of lexemes on each line (using the line numbers shown).
How many lexemes does the following Java code contain? public class RectArea { public static double area(double length, double width) { double area = 0.0: try { area = width*height: } catch (Exception e) { System.out.println ("Error in RectArea.area: " + e.getMessage()): System.exit (1): } return area: } } Give the number of lexemes on each line (using the line numbers shown).

Answers

Lexemes:- Lexemes are the collection of words and symbols in a programming language. These can be anything like identifier, number, string or character.

Number of lexemes:-

1. public class RectArea {

In line 1 there are 4 lexemes, as we can count one by one like public, class, RectArea, and {.

2. public static double area (double length, double width) {

In line 2 there are 12 lexemes, as we can count like public, static, double, area, (, double, length, , , double, width, ), {.

3. double area=0.0;

In line 3 there are 5 lexemes. we can count as above.

4. try {

In line 4 there are 2 lexemes.

5. area=width*height;

In line 5 there are 6 lexemes.

6. } catch(Exception e) {

In line 6 there are 7 lexemes.

7. System.out.println("Error in RectArea.area: " +

In line 7 there are 15 lexemes.

8. e.getMessage());

In line 8 there are 7 lexemes.

9. System.exit(1);

In line 9 there are 7 lexemes.

10. }

In line 10 there are 1 lexemes.

11. return area;

In line 11 there are 3 lexemes.

12. }

In line 12 there are 1 lexemes.

13. }

In line 13 there are 1 lexemes.


Similar Solved Questions

1 answers
Problem 2-20 Plant wide versus Multiple Predetermined Overhead Rates: Service Industry [LO2-1, LO2-2, LO2-3, LO2-4] McCullough...
Problem 2-20 Plant wide versus Multiple Predetermined Overhead Rates: Service Industry [LO2-1, LO2-2, LO2-3, LO2-4] McCullough Hospital uses a job-order costing system to assign costs to its patients. Its direct materials include a variety of items such as pharmaceutical drugs, heart valves, artific...
1 answers
No Service令 11:19 AM +2e Choose the correct expression for net electric field at point P...
No Service令 11:19 AM +2e Choose the correct expression for net electric field at point P → 3kee BE R2 3kee R2 R2...
1 answers
Lin Corporation has a single product whose selling price is $135 per unit and whose variable...
Lin Corporation has a single product whose selling price is $135 per unit and whose variable expense is $54 per unit. The company's monthly fixed expense is $40,280. Required: 1. Calculate the unit sales needed to attain a target profit of $6,700. (Do not round intermediate calculations.) 2. Cal...
1 answers
Gleason purchased a used van for use in its business on January 1, 2017. It paid...
Gleason purchased a used van for use in its business on January 1, 2017. It paid $15,000 for the van. Gleason expects the van to have a useful life of four years, with an estimated residual value of $1,200. Gleason expects to drive the van 21,000 miles during 2017, 16,000 miles during 2018, 33,000 m...
1 answers
Suppose you have a following reaction: How does the reaction rate change increase, decrease, does not...
Suppose you have a following reaction: How does the reaction rate change increase, decrease, does not change) if you: a) increase the concentration of sodium iodide twice b) use n-hexane as a solvent instead of acetone c) use 2-bromopropane as electrophile instead of bromoethane d) use two times hig...
1 answers
E2-33. Comparing Income Statements and Balance Sheets of Competitors Following are selected income statement and balance...
E2-33. Comparing Income Statements and Balance Sheets of Competitors Following are selected income statement and balance sheet data from two retailers, Abercrombie & Fitch (clothing retailer in the high-end market) and TJX Companies (clothing retailer in the value- priced market), for the fiscal...
2 answers
Solve this system by matrices 2x+3y-z=-8 x-y-z=-2 -4x+3y+z=6
solve this system by matrices 2x+3y-z=-8 x-y-z=-2 -4x+3y+z=6...
1 answers
2. [15pt] Implement the following Boolean function using a multiplexer. f(xy.zw) m(0,2,5,8,10,14.15) Carefully label all the...
2. [15pt] Implement the following Boolean function using a multiplexer. f(xy.zw) m(0,2,5,8,10,14.15) Carefully label all the inputs and outputs of your multiplexer and justify your design....
1 answers
1. Let L: R2-R2 be defined by L(x.y) (x +2y, 2x - y). Let S be...
1. Let L: R2-R2 be defined by L(x.y) (x +2y, 2x - y). Let S be the natural basis of R2 and let T = {(-1,2), (2,0)) be another basis for R2 . Find the matrix representing L with respect to a) S b) S and1T c) T and S d) T e) Find the transition matrix Ps- from T basis to S basis. f) Find the transitio...
1 answers
Help with these four analytical chemistry problems. I don't know how to do it and would...
Help with these four analytical chemistry problems. I don't know how to do it and would like to know how to do it along with the correct answer to prepare myself for my exam Note: Show all your work to eam full credit. Type or write your answers neatly and in logical order. 1. (5 points) Dec...
1 answers
QUESTION 12 n some studles the researth subjects are not toid the real purpose of the...
QUESTION 12 n some studles the researth subjects are not toid the real purpose of the research. These are called o a Irvaild 。b, secret Ос.tird od double bind sudes QUESTION 13 ln experiment게 research there are Oa contro ob.expermenca groups of subjects n whichgroup does th...
1 answers
What are the three main purposes of our atmosphere?
What are the three main purposes of our atmosphere?...
1 answers
Question 1 1 pts Formula sheet: Final Exam Formula Sheet.pdf A cubit is an ancient unit...
Question 1 1 pts Formula sheet: Final Exam Formula Sheet.pdf A cubit is an ancient unit of length equal to 44 cm. A "jiffy" is a slang unit of time used in electronics equal to one period of alternating current, or 1/60th of a second. Convert a speed of 1 cubit per jiffy to km/hour. Question...
1 answers
Which of the folllowing systems would produce the highest rate of flow? Which of the folllowing...
Which of the folllowing systems would produce the highest rate of flow? Which of the folllowing systems would produce the highest rate of flow? because the downstream pressure is lowest (60 mmHg) because there is no difference in pressure because the upstream pressure is highest (200 mmHg) Flow wou...
1 answers
You own a portfolio equally invested in a risk-free asset and two stocks (If one of...
You own a portfolio equally invested in a risk-free asset and two stocks (If one of the stocks has a beta of 0.97 and the total portfolio is equally as risky as the market, what must the beta be for the other stock in your portfolio? (Hint: Remember that the market has a Beta=1; also remember that e...
1 answers
Additional data Beverly deposits all cash receipts in the bank and makes all payment The Cash...
Additional data Beverly deposits all cash receipts in the bank and makes all payment The Cash account of Beverly Associates at February 28, 2019. foliows: Click the icon to view the Cash account) Beverly Associates received the following bank statement on February 28, 2019 Click the icon to view the...
1 answers
What is the sum of the arithmetic sequence 9,14,19... if there are 34 terms?
What is the sum of the arithmetic sequence 9,14,19... if there are 34 terms?...
1 answers
A coyote is chasing the road runner around the desert. He goes 6m north, 8m west, 2m north, 4m west, 10m south, and 8m east. What was the coyote's resultant vector?
A coyote is chasing the road runner around the desert. He goes 6m north, 8m west, 2m north, 4m west, 10m south, and 8m east. What was the coyote's resultant vector?...

-- 0.031024--