\begin{homeworkProblem}
	\section{Expressions and Operators}
	\subsection{Syntax Notation}
	In the syntax notation used in this manual, syntactic categories are indicated by \textit{italic} type and literal words are indicated in \textbf{bold} type.\\
	\textit{ $\left\{ expression \right\}$ }
	indicates a required expression in braces.
	\\
	\\
	An optional terminal or non-terminal symbol has the subscript $_{opt}$ appended, so that
	\textit{ $\left\{ expression_{opt}\right\}$ }
	indicates an optional expression in braces.
	
	\subsubsection{Operator Precedence}
	The precedence of expression operators is the same as the order of the major subsections of this section (highest precedence first). Within each subsection, the operators have the same precedence. Left- or right-associativity is specified in each subsection for the operators discussed therein.
	\subsection{Primary Expressions}
	Primary expressions involving . , subscripting, and function calls group left to right.
	\newline	
	\newline
	\textit{identifier}
	\newline
	An identifier is a primary expression, provided it has been suitably declared as discussed below. Its type is specified by its declaration.
	\newline
	\newline
	\textit{constant}
	\newline
	A constant of any of the primitive types discussed in Chapter 3 is a primary expression.
	\newline
	\newline
	( \textit{expression} )
	\newline
	A parenthesized expression is a primary expression whose type and value are identical to those of the unadorned expression. The presence of parentheses does not affect whether the expression is an lvalue.
	
	\subsubsection{Array Literal}
	\textit{$|expression_{opt}|$ }
	\newline
	\textit{$|$ expression-list $|$ }
	\newline
	A string, which originally has the type "array of \textbf{char}", is a primary expresion. An array literal storing another type is also a primary expression.
	
	\subsubsection{Array Access}
	
	\textit{primary-expression}[ \textit{expression} ]
	\newline
	A primary expression followed by an expression in square brackets is a primary expression. The intuitive meaning is that of a subscript. The primary expression has type ‘‘array of . . .’’ and the type of the result is ‘‘. . . ’’. The type of the subscript expression must be a type that is convertible to an integral type, or a compile-time error occurs.
	
	\subsubsection{Function Call}
	\textit{primary-expression} ( \textit{$expression-list_{opt}$} )
	\newline
	A function call is a primary expression followed by parentheses containing a possibly empty, comma-separated
	list of expressions which constitute the actual arguments to the function. The result of the function call is the function's return type. Recursive calls to any function are permissible.
	
	\subsubsection{Object Member Access}
	\textit{primary-lvalue} . \textit{r-value}
	\newline
	\textit{primary-lvalue}: \textit{identifier} $|$ \textbf{this} $|$ ( \textit{expression} ) $|$ \textit{primary-expression}[ \textit{expression} ]
	\newline
	\textit{primary-rvalue}: \textit{identifier} $|$ \textit{primary-expression} ( \textit{$expression-list_{opt}$} )
	\newline
	An lvalue expression followed by a dot followed by the name of a class member is a primary expression. The object referred to by the lvalue is assumed to be an instance of the class defining the class member. The given lvalue can be an instance of any user-defined class.
	
	\subsection{Unary Operations}
	\textit{unary-operator expression}
	\newline
	\textit{unary-operator}: \textbf{not} $|$ \textbf{-}
	\newline
	Expressions with unary operators group right-to-left.
	
	\subsubsection{Logical Not}
	\textbf{not} \textit{expression}
	\newline
	The result of the logical negation operator \textbf{not} is \textbf{true} if the value of the expression is \textbf{false}, \textbf{false} if the value of the expression is \textbf{true}. The type of the result is \textbf{bool}. This operator is applicable only to operands that evaluate to \textbf{bool}.
	
	\subsubsection{Negation}
	\textbf{-}\textit{constant} $|$ \textbf{-}(\textit{expression})
	\newline
	The result is the negative of the expression, and has the same type. The type of the expression must be \textbf{char}, \textbf{int}, or \textbf{float}.
	
	\subsection{Dynamic Memory Management}
	The \textbf{new} operator is used to allocate dynamic memory in two scenarios: array creation and object creation.
	\subsubsection{Array Creation}
	\textbf{new} \textit{type}[\textit{expression}]
	\subsubsection{Object Creation}
	\textbf{new} \textit{identifier}(\textit{$expression_{opt}$})
	\newline
	\textbf{new} \textit{identifier}(\textit{expression-list})
	
	\subsubsection{Memory Deallocation}
	\textbf{delete} \textit{r-value}
	\newline
	The \textbf{delete} operator is used to deallocate heap memory. The \textit{r-value} can be either an l-value or r-value of either an array creation or object creation expression.
	
	\subsection{Multiplicative Operations}
	\textit{expression multiplicative-operator expression}
	\newline
	\textit{multiplicative-operator}: * $|$ $/$ $|$ \%
	\newline
	The multiplicative operators group left-to-right. They operate on numeric types (\textbf{int}, \textbf{char}, \textbf{float}). If both operands are of type \textbf{int}, the result is of type \textbf{int}. If either operand is of type \textbf{float}, then the result is of type \textbf{float}. If either operand if of type \textbf{char}, then the result is of type \textbf{char}.
	
	\subsection{Additive Operations}
	\textit{expression additive-operator expression}
	\newline
	\textit{additive-operator}: + $|$ $-$
	\newline
	The additive operators + and − group left-to-right. They operate on numeric operands (\textbf{int}, \textbf{char}, \textbf{float}). The same type considerations as for multiplication apply. Overflow of a \textbf{char} type during an addition operation results in wraparound.
	
	\subsection{Relational Operations}
	\textit{expression relational-operator expression}
	\newline
	\textit{relational-operator}: $<$ $|$ $>$ $|$ $<=$ $|$ $>=$
	\newline
	The relational operators group left-to-right. They operate on numeric operands (\textbf{int}, \textbf{char}, \textbf{float}). The relational operators all yield \textbf{true} if the specified relation is true and \textbf{false} otherwise.
	
	\subsection{Equality Operations}
	\textit{expression equality-operator expression}
	\newline
	\textit{equality-operator}: == $|$ != 
	
	The == (equal to) and the != (not equal to) operators are exactly analogous to the relational operators except for their lower precedence.
	
	\subsection{Logical Operations}
	\textit{expression logical-operator expression}
	\newline
	\textit{logical-operator}: \textbf{and} $|$ \textbf{or}
	
	Both operands must evaluate to a value of type \textbf{bool}. The \textbf{and} operator returns \textbf{true} if both its operands evaluate to \textbf{true}, \textbf{false} otherwise. The second expression is not evaluated if the first evaluates to \textbf{false}. The \textbf{or} operator returns \textbf{true} if either of its operands evaluate to \textbf{true}, and \textbf{false} otherwise. The second operand is not evaluated if the value of the first operand evaluates to \textbf{true}.
	
	\subsection{Assignment Operation}
	\textit{lvalue = expression}
	\newline
	\textit{primary-lvalue}: \textit{identifier} $|$ $\left\{\textbf{this} | \textit{identifier} \right\}$ . \textit{expression} $|$ \textit{primary-expression}[ \textit{expression} ]
	
	The value of the expression replaces that of the object referred to by the lvalue. Both operands must have the same type.
\end{homeworkProblem}
