Question

1) We should all be accustomed to the PEMDAS operator precedence rules (Parenthesis, exponentials, multiply, modulus,...

1) We should all be accustomed to the PEMDAS operator precedence rules (Parenthesis, exponentials, multiply, modulus, divide, addition, and subtraction) for constant integer expressions. For example, (3 + 4) X (6 -1) = 35 Please describe in your own words how the + and - symbols are used in ways other than for addition and subtraction. Describe what happens to the operator precedence rules when you use the + and - symbols in that manner.

Homework Answers

Answer #1

Solution:

As PEDMAS i.e. (Parenthesis, exponentials, multiply, modulus, divide, addition, and subtraction) defines the order of operation in an expression but conflict occurs when two operator of same precedence are used in the expression. For example "*" and "/" have same precedence and then comes the associativity rule, which can be either from left to right or right to left.

In case of "+" and "-", which are of same precedence and here, associativity rule is from left to right. For example:

1:

200 + 20 / 2 - 3 * 20

=> 200 + 10 - 60

=> 210 - 60

=> 150

2:

500 - 20 * 3 + 100 / 5

=> 500 - 60 + 20

=> 440 + 20

=> 460

There are very specific uses of "+" and "-" operators in programming languages. "+" is used as concatenation operator and "-" operator is used as negation operator.

For example:

"Sam "+"karn" results in Sam karn and - (- 12) results in +12.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1. The failure of the new supply chain system affected Nike adversely. What were the reasons...
1. The failure of the new supply chain system affected Nike adversely. What were the reasons for the failure and how did the breakdown harm Nike? 2. What are the important elements to be kept in mind while implementing a new system in an organization? What is the importance of a good working relationship between partners and the sharing of responsibility in implementing critical projects? What mistakes did Nike and i2 make? 3. comment on the lessons learned and the...
The Business Case for Agility “The battle is not always to the strongest, nor the race...
The Business Case for Agility “The battle is not always to the strongest, nor the race to the swiftest, but that’s the way to bet ’em!”  —C. Morgan Cofer In This Chapter This chapter discusses the business case for Agility, presenting six benefits for teams and the enterprise. It also describes a financial model that shows why incremental development works. Takeaways Agility is not just about the team. There are product-management, project-management, and technical issues beyond the team’s control. Lean-Agile provides...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
Discuss ethical issues that can be identified in this case and the mode of managing ethics...
Discuss ethical issues that can be identified in this case and the mode of managing ethics Enron finds itself in this case. How would you describe the ethical culture and levels of trust at Enron? Provide reasons for your assessment. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From the April 2004 Issue Save Share 8.95 In 1991, Progressive Insurance, an automobile insurer based in Mayfield Village, Ohio, had approximately $1.3 billion in sales. By 2002, that figure had grown to $9.5 billion. What fashionable strategies did Progressive employ to achieve sevenfold growth in just over a decade? Was it positioned in a high-growth industry? Hardly. Auto insurance is a mature, 100-year-old industry...