summaryrefslogtreecommitdiff
path: root/book/module1/classes_and_objects.tex
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2025-04-24 17:37:21 -0600
committerChristian Kolset <christian.kolset@gmail.com>2025-04-24 17:37:21 -0600
commite53c35223bed9a32f1e9cd3fe75caf344d4b5c7e (patch)
tree3a749e57d1ac92f9fdda3f4bb50a3535e6fc72fa /book/module1/classes_and_objects.tex
parent665eaed5e9a677c4d51d066d21aa8ddb612ff565 (diff)
Updated tex files
Diffstat (limited to 'book/module1/classes_and_objects.tex')
-rw-r--r--book/module1/classes_and_objects.tex96
1 files changed, 71 insertions, 25 deletions
diff --git a/book/module1/classes_and_objects.tex b/book/module1/classes_and_objects.tex
index cb9f7ec..b783048 100644
--- a/book/module1/classes_and_objects.tex
+++ b/book/module1/classes_and_objects.tex
@@ -13,29 +13,77 @@
or vehicles)
\end{itemize}
-\begin{longtable}[]{@{}
- >{\raggedleft\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{0.0556}}@{}}
-\toprule\noalign{}
-\begin{minipage}[b]{\linewidth}\raggedleft
-\#\# 2. Core OOP Concepts - A. \textbf{Classes and Objects} -
-Definitions - Syntax in Python - B. \textbf{Attributes and Methods} -
-Instance variables - Functions inside classes - C.
-\textbf{Encapsulation} - Public vs private variables - Using
-\texttt{\_\_init\_\_} and \texttt{self} - D. \textbf{Inheritance} -
-Parent and child classes - Reuse and extension of code - E.
-\textbf{Polymorphism} \emph{(brief overview)} - Method overriding -
-Flexibility in interfaces
-\end{minipage} \\
-\midrule\noalign{}
-\endhead
-\bottomrule\noalign{}
-\endlastfoot
-\#\# 3. Python OOP Syntax and Examples - A. Define a simple class (e.g.,
-\texttt{Spring}) - B. Instantiate objects and use methods - C. Show
-\texttt{\_\_init\_\_}, \texttt{\_\_str\_\_}, custom methods - D. Add a
-derived class (e.g., \texttt{DampedSpring} inherits from
-\texttt{Spring}) \\
-\end{longtable}
+\subsection{2. Core OOP Concepts}\label{core-oop-concepts}
+
+\begin{itemize}
+\tightlist
+\item
+ A. \textbf{Classes and Objects}
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Definitions
+ \item
+ Syntax in Python
+ \end{itemize}
+\item
+ B. \textbf{Attributes and Methods}
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Instance variables
+ \item
+ Functions inside classes
+ \end{itemize}
+\item
+ C. \textbf{Encapsulation}
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Public vs private variables
+ \item
+ Using \texttt{\_\_init\_\_} and \texttt{self}
+ \end{itemize}
+\item
+ D. \textbf{Inheritance}
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Parent and child classes
+ \item
+ Reuse and extension of code
+ \end{itemize}
+\item
+ E. \textbf{Polymorphism} \emph{(brief overview)}
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Method overriding
+ \item
+ Flexibility in interfaces
+ \end{itemize}
+\end{itemize}
+
+\subsection{3. Python OOP Syntax and
+Examples}\label{python-oop-syntax-and-examples}
+
+\begin{itemize}
+\tightlist
+\item
+ A. Define a simple class (e.g., \texttt{Spring})
+\item
+ B. Instantiate objects and use methods
+\item
+ C. Show \texttt{\_\_init\_\_}, \texttt{\_\_str\_\_}, custom methods
+\item
+ D. Add a derived class (e.g., \texttt{DampedSpring} inherits from
+ \texttt{Spring})
+\end{itemize}
\subsection{4. Engineering Applications of
OOP}\label{engineering-applications-of-oop}
@@ -57,8 +105,6 @@ OOP}\label{engineering-applications-of-oop}
C. Organizing simulation code with OOP
\end{itemize}
-\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
-
\subsection{5. Hands-On Coding Activity}\label{hands-on-coding-activity}
\begin{itemize}