\documentclass[12pt]{article}
\usepackage{amssymb, hhline}

\setlength{\textheight}{9.5in}
\setlength{\topmargin}{-0.6in}
\newcommand{\lechoose}[2]{{{#1} \choose {{\mathop \le} #2}}}
\begin{document}
%%\pagestyle{empty}

\def\eee{\mathrm{e}}
\def\ra{\rightarrow}
\def\mn{\medskip\noindent}
\def\diam{\mbox{{\rm diam}}}
\def\ol{\overline}
\def\zzz{\Bbb Z}

\begin{center}
{\large{Fundamentals of Computer Programming 2 \\
      Notes and Practice Problems -- August 13, 2003 }}
\end{center}

\noindent Instructor: Ravi Kant \quad Ryerson 177 \quad e-mail:  {\tt ravikant@cs.uchicago.edu}  \\
Office Hours : Fri : 1:00PM - 3:00PM (or by appointment) \\

\vspace{0.5cm}

\noindent {\bf Classes} \\

\noindent {\tt Class classname \{ \\
\hspace*{0.5cm} private : \\
\hspace*{1cm}} data and function declarations \\
{\tt \hspace*{0.5cm} public : \\
\hspace*{1cm}} data and function declarations \\
\} \\
   
\begin{itemize}
\item {\tt private} members (functions and data) cannot be accessed from outside the class.
\item {\tt public} members have access to both the {\tt private} members and other {\tt public} members.
\item Only the {\tt public} members can be accessed from outside the class definition.
\end{itemize}

\noindent {\bf Practice problems } :  \\

\begin{enumerate}
\item  Study the examples. For the class ``complex'' defined in the examples write the following member functions :

\begin{enumerate}

\item {\tt double abs()} which calculates the absolute value of the complex number ( abs($x+iy$) = $\sqrt{x^2 + y^2}$).

\item {\tt double reciprocal()} which calculates the reciprocal ($1/(x+iy)$) for the complex number $x+iy$.

\end{enumerate}

\item Write the following functions for doing complex arithmetic 

\begin{enumerate}

\item {\tt complex product(complex z1, complex z2)} for calculating the product of the 2 complex numbers z1 and z2.

\item {\tt complex ratio(complex z1, complex z2)} for calculating $z1/z2$.

\item {\tt complex pow(complex z1, complex z2)} for calculating $z1^{z2}$.

\end{enumerate}
\end{enumerate}
\end{document}