\documentclass[12pt,twoside]{article}
\usepackage[parfill]{parskip}  
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{epstopdf}
\usepackage{underscore}
\usepackage{caption}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
\usepackage{fourier}
\usepackage{listings}
\lstset{
	language=java,
	tabsize=4,
	frame=trbl,
	columns=fullflexible,
	escapechar=\#,
	basicstyle=\sffamily,
	stringstyle=\textit,
	showstringspaces=false}
\usepackage{pdfpages}
%\usepackage{pdfsync}
% from use-full-height.tex
\setlength{\textheight}{9.5in}
\setlength{\headheight}{.60in}
\setlength{\headsep}{.40in}
\setlength{\topmargin}{-1.5in}

% from use-full-width.tex
\setlength{\textwidth}{6.5in} 
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}

% crowd figures and text on pages to reduce page count
\renewcommand\floatpagefraction{.9}
\renewcommand\topfraction{.9}
\renewcommand\bottomfraction{.9}
\renewcommand\textfraction{.1}   
\setcounter{totalnumber}{50}
\setcounter{topnumber}{50}
\setcounter{bottomnumber}{50}

% use san-serif for code
\renewcommand{\ttdefault}{\sfdefault}

% ----------------------------------------------------------------
% Question formatting macros
% ----------------------------------------------------------------
\newcommand{\fillInBlank}[1][0.5in]{\underline{\hspace{#1}}}
\newcommand*{\fixme}[1]{\textsc{To be fixed:} \emph{{#1}}}

% #1 answer: T, F, or none to hide
% #2 question text
\newcommand*{\truefalse}[2][none]{\hspace{0.25in}%
\ifthenelse{\equal{#1}{none}}{T\hspace{0.15in}F}{%
	\ifthenelse{\equal{#1}{T}}{T\hspace{0.25in}}{%
		\hspace{0.25in}F}}%
\hspace{0.15in}{#2}}

\newcommand*{\bigoh}[1]{\ensuremath{\mathrm{O}({#1})}}

\newcommand*{\littleoh}[1]{\ensuremath{\mathrm{o}({#1})}}

\newcommand*{\bigtheta}[1]{\ensuremath{\Theta({#1})}}
% ----------------------------------------------------------------

\renewcommand{\labelenumi}{\alph{enumi}.}

\newcommand{\code}[1]{\texttt{#1}}

\frenchspacing

\begin{document}
%\maketitle

\begin{flushright}
Name: \fillInBlank[3in] Section: \fillInBlank[1in]

\LARGE{CSSE 220---Object-Oriented Software Development}

\Large{Exam 1 -- Part 2, Dec. 19, 2013}
\end{flushright}

\textbf{Allowed Resources on Part 2.} \hspace{0.15in}
Open book, open notes, and computer. Limited network access. You may use the network only to access your own files, the course Moodle and Piazza sites (but obviously don't post on Piazza) and web pages, the textbook's site, Oracle's Java website, and Logan Library's online books.


\textbf{Instructions}.\hspace{0.15in}
\emph{You must disable Microsoft Lync, IM, email, and other such communication programs
before beginning part 2 of the exam. Any communication with anyone other than the instructor
or a TA during the exam may result in a failing grade for the course.}

You must actually get these problems working on your computer. Almost all of the credit for the problems will be for code that actually works. There are several different small methods to write, so you can get a lot of partial credit by getting some of them to work.  If you get every part working, comments are not required.  If you do not get a method to work, comments may help me to understand enough so I can give you (a small amount of) partial credit.  

\textbf{Begin part 2 by checking out the project named \emph{Exam1-201420} from your course SVN repository}.  (Ask for help immediately if you are unable to do this.)

When you have finished a problem, and more frequently if you wish, \textbf{submit your code by committing it to your SVN repository}.  We will check commit logs, so you must be careful not to commit anything after the end of the exam.  For grading, we will ensure that the included JUnit tests have not been changed.

\emph{Part 2 is included in this document.}
\textbf{Do not use non--approved websites like search engines (Google) or any website other than those above.}  Be sure to turn in the these instructions, with your name written above, to your exam proctor. You should not exit the examination room with these instructions.

\clearpage
{\Large Part 2---Computer Part}

\vspace{0.25in}
\hrule
{\large Problem Descriptions}

\textbf{Part A: 5 Small Problems} (30 points) Implement the code for the 5 functions in \code{SmallProblems.java} -- each problem is worth 6 points.  Instructions are included in the comments of each function.  Unit tests are included in \code{SmallProblemsTest.java}.

\vspace{0.15in}

\textbf{Part B: Test This Class} (5 points) Implement a unit test for the function in \code{TestThisClass.java}.  You will add a file \code{TestThisClassTest.java} that will contain your test.  Your test should have 3 assertions that test a variety of cases, but need not be exhaustive.

\vspace{0.15in}

\textbf{Part C: User Input} (6 points) Modify the empty class \code{UserInput.java} to add a main fundtion and interact with the user on the console.  Instructions are in the file itself.

\vspace{0.15in}

\textbf{Part D on next page}

\clearpage

\textbf{Part D: HourTimer} (24 points) 

\begin{figure}
	\begin{center}
		\includegraphics[width=0.32\linewidth]{stage1.png}
		\includegraphics[width=0.32\linewidth]{stage2.png}
		\includegraphics[width=0.32\linewidth]{stage3.png}
	\end{center}
	\caption*{Stage 1 (left). Stage 2 (center). Stage 3 (right).
Note that the dotted lines are just for reference and are drawn for your by HourTimerComponent.}
	\label{fig:one}
\end{figure}


Read over all these instructions carefully.  Make sure you understand completely what functionality you have to implement before you start coding.  Ask if any part of the instructions are unclear.

Implement the \code{HourTimer} class.  The \code{HourTimer} demonstrates a circular timer that can represent any number of minutes (like a clock with only a minute hand).

A few details about how to draw the \code{HourTimer}:
\begin{itemize}
\item The minute hand's length is 0.9 times the radius of the
\code{HourTimer}\\(\code{RATIO_OF_HAND_LENGTH_TO_RADIUS}).
\item The minute
hand's width is 0.1 times the radius of the \code{HourTimer}\\ (\code{RATIO_OF_HAND_WIDTH_TO_RADIUS}). 
\item Initially the \code{HourTimer} should have it's minute hand pointing vertically upward (representing 0 minutes).
\end{itemize}


\begin{itemize}
\item[Stage 1] The \code{HourTimer} should be able to be constructed with no parameters.  In that case it is to be drawn centered at the point 300,300 (\code{DEFAULT_CENTER_X} and \code{DEFAULT_CENTER_Y}).  Its default radius is 300 (\code{DEFAULT_RADIUS}).


\item[Stage 2]  
You'll need to uncomment the stage 2 code in \code{HourTimerComponent}.

Add a 3 parameter constructor.  Use the example Stage 2 code in \code{HourTimerComponent} to infer what the parameters ought to be.  When you're finished, the clocks should be able to be drawn in different places and at different sizes.


\item[Stage 3] 
You'll need to uncomment the stage 3 code in \code{HourTimerComponent}.

Finally, add rotation.  Implement the \code{setTime} function that takes a number of minutes as a parameter.  When this is set the minute hand should be drawn rotated to the appropriate number of minutes, like the minute hand of a clock (e.g. 30 causes the hand to be drawn vertically downward, 45 causes the hand to be drawn horizontally to the left, etc.).

\end{itemize}


\vspace{.75in}

\begin{flushright}
\begin{tabular}{rcc}
\textbf{Part A} & \textbf{Points} & \textbf{Earned} \\
\code{isMiddleCharacterQ} & 6 & \fillInBlank\\
\code{interleaveArrays} & 6 & \fillInBlank\\
\code{insertAtMiddle} & 6 & \fillInBlank\\
\code{addOneToArray} & 6 & \fillInBlank\\
\code{missingInt} & 6 & \fillInBlank\\
\textbf{Part B \code{TestThisClass}} &  & \\
Setup TestThisClassTest & 2 & \fillInBlank \\
Assert statements (1 point each) & 3 & \fillInBlank \\
\textbf{Part C \code{UserInput}} &  & \\
Setup main method  & 2 & \fillInBlank \\
Get user input  & 2 & \fillInBlank \\
Display appropriate message & 2 & \fillInBlank \\
\textbf{Part D \code{HourTimer}} &  & \\
Stage 1 functionality  & 8 & \fillInBlank \\
Stage 2 functionality & 8 & \fillInBlank \\
Stage 3 functionality & 8 & \fillInBlank \\
\textbf{Computer Part Subtotal} & \textbf{65} & \fillInBlank
\end{tabular}
\end{flushright}


\end{document}  
