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
Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two
svlad2 [7]

Answer:

The program in Python is as follows:

currentPrice = int(input("Current: "))

lastMonth = int(input("Last Month: "))

print("The house is $",currentPrice)

print("The change is $",(currentPrice-lastMonth),"since last month")

print("The estimated monthly mortgage is $",(currentPrice * 0.051) / 12)

Explanation:

Get input for current price

currentPrice = int(input("Current: "))

Get input for last month price

lastMonth = int(input("Last Month: "))

Print current price

print("The house is $",currentPrice)

Print change since last month

print("The change is $",(currentPrice-lastMonth),"since last month")

Print mortgage

print("The estimated monthly mortgage is $",(currentPrice * 0.051) / 12)

6 0
3 years ago
Define application software​
sp2606 [1]

Answer: An application software is a type of software that the user interacts with, while a system software is a type of software that the system interacts with.

Hope this helped you :)

7 0
3 years ago
If the programmer translates the following pseudocode to an actual programming language, a syntax error is likely to occur. Can
maxonik [38]

Answer:

if, then, else

Explanation:

you specified that if you enter award for 1st prize then it'll display 1st prize but you didnt specify what will happen if user does not enter 1st prize or what happens if 1st prize is not allocated. To me it looks like you got the 'if' and 'then' part correct but you dont have a 'else' part to it therefore it'll create an error when its not declared.

8 0
2 years ago
Digital _________ Line is a family of point-to-point technologies designed to provide high-speed data transmission over traditio
disa [49]

Answer:

D. Subscriber

Explanation:

Digital Subscriber Line is a family of point-to-point technologies designed to provide high-speed data transmission over traditional telephone lines.

The high speed data transmission property helps to transmit data in a fast and timely manner between two or more points or people during calls, texts and other activities.

6 0
3 years ago
What is the name given to a value that does NOT change when used within a formula? *
CaHeK987 [17]
The answer is C. constant.
6 0
3 years ago
Read 2 more answers
Other questions:
  • When you right-click certain areas of the Word or other Office app windows, a command menu will appear. Group of answer choices
    13·1 answer
  • Why would a person who handles electronic components wear a grounded wrist strap
    13·1 answer
  • Determine the exact output of the code $str = "The quick brown fox jumps over the the lazy dog"; echo strpos($str, 'fox');
    6·1 answer
  • Consider the following MARIE Code: 100 If, Load X /Load the first value 101 Subt Y /Subtract the value of Y, store result in AC
    8·1 answer
  • Which of the following statements about software licensing are true? Select 3 options.
    5·1 answer
  • According to the video, what types of education are useful for Database Administrators? Check all that apply.
    5·2 answers
  • What are the peripherals of a computer ​
    12·1 answer
  • Hawaii and japan are examples of islands made by? You have to write it.
    11·1 answer
  • The purpose of a flowchart is similar to the purpose of pseudocode.<br> True<br> False
    5·2 answers
  • Tristan just downloaded a new game he wants to play on his computer. What kind of file should he open in order to install and ru
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!