-
Notifications
You must be signed in to change notification settings - Fork 12
/
template.tex
53 lines (44 loc) · 1.21 KB
/
template.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
% A template for homeworks that I'll complete in CSC 134
% written by Walter B. Vaughan
\documentclass[11pt]{article}
\author{Walter B. Vaughan\\
\small CSC 134 -- Section 200 -- Fall 2014\\
\small Catawba Valley Community College}
\title{Template Page}
\date{\vspace{-5ex}}
\usepackage{listings}
\usepackage[usenames,dvipsnames]{color}
\usepackage[margin=.5in]{geometry}
\usepackage{indentfirst}
\lstset{frame=tb,
language=C++,
columns=flexible,
basicstyle={\small\ttfamily},
numbers=left,
numberstyle=\color{Gray},
keywordstyle=\color{BlueViolet},
commentstyle=\color{Gray},
stringstyle=\color{OliveGreen},
breaklines=true,
breakatwhitespace=true,
showstringspaces=false,
tabsize=4
}
\begin{document}
\maketitle
\section*{Questions}
\begin{enumerate}
\item The correct answer would be \lstinline{const double y = 24.632;}.
\item More correct answers go here.
\item And a final, slightly more correct answer follows:
\begin{lstlisting}
// does some C++ things and then boops
#include <iostream>
int main() {
const char GRADE = 'A';
cout << "My grade is " << GRADE << " in CSC 134" << endl;
cout << "because I can computer good." << endl;
}
\end{lstlisting}
\end{enumerate}
\end{document}