\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, Mar. 28, 2014}
\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-201430} 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}.

\textbf{Part B on next page}

\clearpage

\textbf{Part B: Suns} (35 points) 

\begin{figure}
	\begin{center}
		\includegraphics[width=0.32\linewidth]{Suns1.png}
		\includegraphics[width=0.32\linewidth]{Suns2.png}
		\includegraphics[width=0.32\linewidth]{Suns3.png}
	\end{center}
	\caption*{Post Step 4 (left). Post Step 5 (center). Post Step 7 (right).}
	These images are in your repositories. Note that the color may be washed out in the images, just use Color.RED and Color.YELLOW (or constants where you can) and it will be correct.
	\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{SunComponent} and \code{Sun} classes.  The \code{SunComponent} is responsible for creating Sun objects and telling them when to draw. The \code{Sun} object is responsible for drawing the \code{Sun}'s circles and rays to the screen.

A few details about how to draw the \code{Sun}:
\begin{itemize}
\item The x and y values stored in a \code{Sun} make the upper left point of the \code{Sun} when drawn.
\item The space between the circle of a Sun and it's rays is equal to 20\% of the Sun's circle's diameter: (\code{RAY_DISTANCE_FROM_SUN_SCALE})
\item The length of a ray is 50\% of a Sun's diameter: (\code{RAY_LENGTH_SCALE})
\item The width of a ray is 10\% of a Sun's diameter: (\code{RAY_WIDTH_SCALE})
\item The circleDiameter field is the diameter of the circle in the center of the \code{Sun}, not the entire size of the \code{Sun}.
\end{itemize}


\begin{itemize}
\item[Step 1] 
In the \code{SunComponent} class, find TODO: Step 1 and follow the instructions provided.


\item[Step 2] 

In the \code{SunComponent} class, find TODO: Step 2. Use a default constructor to create a new instance of the \code{Sun} class.

\item[Step 3] 
In the \code{Sun} class, find TODO: Step 3. Implement the default constructor of the \code{Sun} class, using the following default information (also see constants in \code{Sun} class):
\begin{itemize}
\item X value should be 100.0
\item Y value should be 100.0
\item Diameter should be 100.0
\item Color should be Yellow
\end{itemize}

You may do other operations in the constructor if you think they will be useful to you later.

\newpage
\item[Step 4] 
In the \code{Sun} class, find TODO: Step 4. Implement the circle drawing portion of the drawOn method. When done with step, run your program and make sure it appears like the left image from  Step 4 above.


\item[Step 5] 
In the \code{Sun} class, find TODO: Step 5. Implement the\code{drawRays} method of the \code{Sun} class. Next, call this method from \code{drawOn}. When done with step, run your program and make sure it appears like the center image on Page 3.

\item[Step 6] 
In the \code{Sun} class, find TODO: Step 6. Implement a constructor with the specified parameters.

\item[Step 7] 
In the \code{SunComponent} class, find TODO: Step 7. Implement a loop that creates an array of \code{Sun} objects and draws them, using the following information (also see constants in \code{SunComponent} class):

\begin{itemize}
\item Little Suns start at x = 50 
\item Little Suns have a circle diameter of 30.0 
\item Little Suns are yellow
\end{itemize}

When you have completed this step, run your program. It should appear like the Step 7 image on the right on Page 3.

\end{itemize}




\vspace{.75in}

\begin{flushright}
\begin{tabular}{rcc}
\textbf{Part A - Small Problems} & \textbf{Points} & \textbf{Earned} \\
\code{isSecondToLastCharacterV} & 6 & \fillInBlank\\
\code{combineArrays} & 6 & \fillInBlank\\
\code{insertAtMiddle} & 6 & \fillInBlank\\
\code{removeStringsGreaterThanLength4} & 6 & \fillInBlank\\
\code{removeItemsFromList} & 6 & \fillInBlank\\
\textbf{Part B - \code{Sun} and \code{SunComponent}} &  & \\
Step 1 functionality  & 2 & \fillInBlank \\
Step 2 functionality & 5 & \fillInBlank \\
Step 3 functionality & 5 & \fillInBlank \\
Step 4 functionality & 5 & \fillInBlank \\
Step 5 functionality & 5 & \fillInBlank \\
Step 6 functionality & 8 & \fillInBlank \\
Step 7 functionality & 5 & \fillInBlank \\
\textbf{Computer Part Subtotal} & \textbf{65} & \fillInBlank
\end{tabular}
\end{flushright}


\end{document}  
