Programming Logic and Design: Ninth Edition
Programming Logic and Design: Ninth Edition
Ninth Edition
Chapter 2
Elements of High-Quality Programs
• Snake casing
– Parts of variable names are separated by underscores such
as hourly_wage
• Mixed case with underscores
– Similar to snake casing, but new words start with a
uppercase letter such as Hourly_Wage
• Kebob case
– Parts of variable names are separated by dashes such as
hourly-wage
• Rules of precedence
– Also called the order of operations
– Dictate the order in which operations in the same
statement are carried out
– Expressions within parentheses are evaluated first
– All the arithmetic operators have left-to-right associativity
– Multiplication and division are evaluated next
• From left to right
– Addition and subtraction are evaluated next
• From left to right
Examples of declarations:
num sqFeet // sqFeet is an estimate provided by
the seller of the property