你校思博 CSC 3002 期末复习
全是思博不定项选择,出题人柠檬水了
Compiler
\[\begin{aligned}
&Compilers, e.g.,\\
&– Microsoft\ Visual\ C++ compiler\\
&– GCC (GNU\ Compiler\ Collection)\\
&– MinGW (Minimalist\ GNU\ for\ Windows)\\
&GUI\ and\ additional\ libraries\ support, e.g.,\\
&– Qt (Design\ Studio)\\
&– MFC (Microsoft\ Foundation\ Classes)\\
&– StanfordCPPLib (from\ the\ textbook)\\
&– OpenCV (Open\ source\ computer\ vision\ libraries)
\end{aligned}
\]
The structure of a C++ Program
\[\begin{aligned}
&\textbf{comments}:注释\\
&multi-line\ comments:/**/\\
&single-line\ comments://\\
&\textbf{libirary}:库\\
&The\ standard\ C++\ libraries\ use\ a\ namespace\ called\ \textbf{std},\\
&Preprocessor\ directives\ are\ not\ program\ statements\ but\
directives\\&for\ the\ preprocessor, which\ examines\ the\ code\
before\ actual\ compilation.\\
&\textbf{Imperative programming paradigm}:an\ explicit\ sequence\ of\
statements\ that\\&change\ a\ program's\ state, specifying\ how\ to\
achieve\ the\ result.\\
&\textbf{The “declare-before-use” rule}:\\
&A\ C++\ program\ consists\ of\ various\ entities\ such\ as\ variables,
functions,\\& types, and\ namespaces. Each\ of\ these\ entities\
must\ be\ declared\\& before\ they\ can\ be\ used.\\
&\textbf{function prototype}:函数声明\\
&\textbf{primitive types}:int\ double\ char\ bool\\
&\textbf{variables:}A\ variable\ is\ a\ named\ address\ for\ storing\ a\ type\ of\ value.\\& Each\ variable\ has\ name, type, value. The\ address\ and\ type\ are\ fixed.\\
&\textbf{Variable name is case sensitive.}区分大小写\\
\end{aligned}
\]
\[\begin{aligned}
&local\ variable=automatic\ variable\ 临时变量\\
&instance\ variable\ 实例变量\\
&\textbf{name blinding}:名称绑定\\
&\textbf{scope}:变量作用地方\\
&\textbf{extent\lifetime}:变量作用时间\\
&\textbf{operands}:参与运算的元素\\
&\textbf{type case}:类型转换\\
&\text{increment operator}:++\\
\end{aligned}
\]
Functions and Libraries
\[\begin{aligned}
&\textbf{Programming Paradigms}:程序范式\\
\text{supports the procedural and object-oriented paradigms
naturally, supports the functional paradigm through the
<functional> interface}.\\
&\textbf{argument:}实参\\
&\textbf{parameter:}形参\\
&\text{A parameter is a placefolder for the parameter}\
\end{aligned}
\]
The advantages of using functions
\[\begin{aligned}
&\textbf{shorten the program}:reuse\ the\ functions\\
&\textbf{easier to read}:abstraction(name many operations)\\
&\textbf{simplfy program maintenance}:decomposition\ the\ program\ into\ smaller\ pieces;\\
&\textbf{Top-down design/stepwise refinement}
\end{aligned}
\]
Define functions
\[\begin{aligned}
&\textbf{predicate function:}Functions\ that\ return\ Boolean\ results\\
&\textbf{procedure}:functions\ that\ return\ no\ value\ at\ all\\
&\textbf{signature}:the\ pattern\ of\ arguments (i.e., the\ number\ and\ types\ of\ the\
arguments\ but\ not\ the\ parameter\ names)\ required\ for\ a\
particular\ function
\end{aligned}
\]