Lecture 11 Flashcards

(3 cards)

0
Q

Precedence:

  1. What is precedence?
  2. Why is precedence important?
  3. An example of precedence?
A
  1. ~the order in w/c different operators are executed
    ~mostly same algebra
  2. ~ it will reduce the chances of miscommunication between you and the computer
    ~ it’s best to make your code clear, but when things get ambiguous, the order of precedence are the rules that the computer will follow, hence someone reading your code can still “figure out” your code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Arithmetic Operators:

  1. What are arithmetic operators?
  2. Why are arithmetic operators important?
  3. How do are arithmetic operators important used?
A
  1. ~addition +, subtraction -, multiplication *, division /
  2. ~you can now manipulate and process data
    ~ instead of reading it in and re-displaying it
  3. ~place them between 2 values, like an algebraic expression
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Associativity:

  1. What is associativity?
  2. Why is associativity important?
  3. An example of associativity?
A
  1. ~the order in w/c same operations are executed
    ~mostly the same as algebra
  2. ~ it will reduce the chances of miscommunication between you and the computer
    ~ it’s best to make your code clear, but when things get ambiguous, the order of precedence are the rules that the computer will follow, hence someone reading your code can still “figure out” your code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly