1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
IRINA_888 [86]
2 years ago
5

Write a recursive decent algorithm for a java while statement, a Javas if statement , an logical/mathematical expression based o

n the rules you created in your lexical analyzer, and an mathe- matical assignment statement, where statement may be an empty function. Supply the EBNF rule for ea
Computers and Technology
1 answer:
Aleonysh [2.5K]2 years ago
3 0

Using the knowledge in computational language in JAVA it is possible to write a code that recursive decent algorithm for a java while statement, a Javas if statement , an logical/mathematical expression.

<h3>Writting the code in JAVA:</h3>

<em>M ---> { S } ' # '</em>

<em>S ---> I | W | A | P | C | G</em>

<em>I ---> ' [ ' E ' ? ' { S } ' : ' { S } ' ] ' | ' [ ' E ' ? ' { S } ' ] '</em>

<em>W --- > ' { ' E ' ? ' { S } ' } '</em>

<em>A --- > lower-case ' - ' E ' ; '</em>

<em>P --- > ' < ' E ' ; '</em>

<em>G ---> ' ' . ' lower case ' ; '</em>

<em>C ---> ' < ' upper case ' ; '</em>

<em>E ---> T { ( ' + ' | ' - ' ) T }</em>

<em>T ---> U { ( ' * ' | ' / ' | ' % ' ) U }</em>

<em>U ---> F ' ^ ' U | F</em>

<em>F ---> ' ( ' E ' ) ' | lower case | digit</em>

<em>Here "lower-case" stands for a single lower-case letter, and "upper-case" stands for a single upper-case letter. For a more colorful grammar (in a slightly different form), see colorful grammar.</em>

<em>This grammar (and the language it defines) may look a little strange, but it was designed to have only single-character tokens. In particular it doesn't have any reserved words (key words), though in a sense the upper-case letters are reserved.</em>

<em>Just to help with understanding, here is the intuitive meaning of each of the above non-terminals:</em>

<em>SYMBOL MEANING</em>

<em>M Main Program</em>

<em>S Statement</em>

<em>I If-Then-[Else] Statement</em>

<em>W While Statement</em>

<em>A Assignment Statement</em>

<em>P Put or Print (integer)</em>

<em>C Print Character</em>

<em>G Get (integer)</em>

<em>E Expression (logical or arith)</em>

<em>T Termi</em>

<em>U </em>

<em>F Factor</em>

See more about JAVA at brainly.com/question/12975450

#SPJ1

You might be interested in
URGENT!! Ronald wants to search for an image of a sports car. Ronald doesn’t have to remember the specific name of the image to
vaieri [72.5K]

Answer:

Ronald will use a search engine

Explanation:

Ronald will use a search engine to find an image of a sports car, like he would do to search information to help him with his homeworks.

He could use keywords to identify some features he wants to see in the picture.  For example "red sports car" or "Ferrari sports car".  The results might come from a general Web spider fetch job or from specialized sites in terms of stock photos for example.

Then, Ronald will be able to see many images matching its request... and choose the one most appropriate for his needs.

5 0
4 years ago
.____________ is a way to identify and differentiate goods andservices through use of a name or distinctive design element.
padilas [110]

Answer: Brand

Explanation:

A brand is a way to identify and differentiated the good and services as, brand is the process, which is used for the business and the marketing strategies. Basically, it is used as communication method for distinguished the products and the company for creating the good impression for customers. Brand awareness and management is the main key components.  

3 0
4 years ago
What is the analysis and complexity of a shell sortalgorithms?
Llana [10]

Answer: The shell sort is based on insertion sort. Here the list of elements are divided into smaller sub list which are sorted based on insertion sort.

Its best case time complexity is O(n* logn) and worst case is O(n* log^2 n)

Explanation:

Shell sort is an inplace sorting here we begin by dividing the list into sublist and sorting the list with insertion sort. We create interval for dividing the list into sub list until we reach the smallest interval of 1.

The best case is O(n* logn).

6 0
3 years ago
Convert to different number system as mentioned.(17)10=(?)2​
Scorpion4ik [409]
“convert to a different number system as mentioned” there was no number system mentioned, but if you are just trying to find 17 * 10 = x * 2

all you need to do is find that 17 * 10 = 170 and 170/2 is 85 so

17 * 10 = 85 * 2
3 0
3 years ago
What is the value of x after each of the following statements is encountered in a computer program, if x=1 before the statement
steposvetlana [31]

Answer:

x=2

x=1

x=2

Explanation:

a)

This if statement if (1+2=3) checks if the addition of two numbers 1 and 2 is true. Here the addition of 1 and 2 is 3 which is true. So the condition becomes true.

Since the condition is true x:=x+1 statement is executed. This statement means that the value of x is incremented by 1.

The value of x was 1 before the if statement is reached. So x:=x+1 statement will add 1 to that value of x.

x:=x+1 means x=x+1 which is x=1+1 So x=2

Hence value of x is 2 (x=2) after the execution of x:=x+1

b)

In statement b the value of x will be 1 because both the mathematical operations in the if statement evaluate to false.

which means in b, x:=x+1 will not be executed and value of x remains unchanged i.e x=1

In (c) the value x will be 2 because the condition in the if statement is true. Both mathematical expressions 2+3=5 and 3+4=7 are true. Therefore x:=x+1 will be executed and value of x will be incremented by 1. Hence x=2

5 0
3 years ago
Other questions:
  • What is the correct order of network types when categorized by their size or the physical area they cover, from largest to small
    5·1 answer
  • What feature did the 32X add to the Sega Genesis?
    13·1 answer
  • To close a tab, click the ____ button in the web page thumbnail on the tab switcher.
    9·1 answer
  • Create a network for a company that sells shoes. Describe the hardware needed and the size of the network (PAN, LAN, WAN) and ma
    6·1 answer
  • Find the number of ideal integers within the given segment [low,high] inclusive. An ideal number is a positive integer that has
    9·1 answer
  • Two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends decide to split the bi
    5·1 answer
  • Talia was a scientist whose research compared the birth rates of young
    12·2 answers
  • A pointer is the memory address of a variable. FALSE TRUE
    9·1 answer
  • What is Identity Theft?
    8·1 answer
  • A(n) ____ is a live internet presentation that supports interactive communications between the presenter and the audience.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!