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
Aleks04 [339]
3 years ago
11

Create an unambiguous grammar which generates basic mathematical expressions (using numbers and the four operators +, -, *, /).

Without parentheses, parsing and mathematically evaluating expressions created by this string should give the result you'd get while following the order of operations. For now, you may abstract "number" as a single terminal, n. In the order of operations, * and / should be given precedence over + and -. Aside from that, evaluation should occur from left to right. So 8/4*2 would result in 4, not 1.
Computers and Technology
1 answer:
Anastasy [175]3 years ago
8 0

Answer:

Explanation:

Let G denote an unambiguous Grammar capable of producing simple mathematical expressions, involving operators +,-,*,/. These operators are left associative (which ensures left to right evaluation). S is the start symbol of the Grammar i.e. the production starts from S. n denotes a number and is a terminal i.e. we can't produce anything further from n. Then, the solution is as follows :

S → S + T |S - T | S

T→T | F | T*F|F

F → n

Here, S, T and F are variables. Note that /,* have been given precedence over +,-.

You might be interested in
What is the average time a caller waits for an operator to answer?
kaheart [24]
3-4 minutes is about right is say
7 0
3 years ago
What is all about programming interactions in the real world.
Lynna [10]

Answer:

Programming is everywhere in the modern world and meets you in the street, your workplace, and the local grocery store. You interact with bar-code scanners regularly, and you almost certainly use lots of code while working, whether you're using a word processor to write a letter or an email platform to send messages. Programs used in real-world environments should also be programmed in the real world, so we have developed a new programming paradigm, “Real-World Programming (RWP),” which enables users to make programs for handling real-world environments as well as data in computers

7 0
3 years ago
Karel coding 2.1.4 superkarel cleanup
kherson [118]

Answer:

hi, try using Code Plans

Explanation:

it is a free website that include videos and articles on this stuff

6 0
3 years ago
Read 2 more answers
The programming language that translates digital data into printer commands is known as
jolli1 [7]
The answer is C.) PostScript
8 0
3 years ago
The short-range two-way communication technology behind contactless payments is called ____.
sasho [114]
Near field communication
4 0
1 year ago
Other questions:
  • Canadian Tire is one of Canada’s largest companies. They operate four large distribution centers service over 470 tire retail ou
    5·1 answer
  • To edit the color of the text in presentation software, choose the Font color command Text Color in the ________ ribbon toolbar.
    15·2 answers
  • Which are technical and visual demands that need to be considered when planning a project? Choose three answers
    10·1 answer
  • Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less
    15·1 answer
  • Define get_date() function.
    6·1 answer
  • . When would one use the analytic application fraud detection?
    12·1 answer
  • Data are sent through a network on bundles called _______. select one:
    8·2 answers
  • Exercise 3.6.9: 24 vs. "24"5 points
    7·1 answer
  • Ken is a mobile app developer. He is designing a mobile app that offers tips and guidance to people interested in learning jazz
    8·2 answers
  • program 2. write a VB.NET program to solve the linear equation of the form Ax+B=C, i.e x=(C=B)/A (Eg:2x+3=7, where B and C are c
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!