\magnification1200\footline{\ifnum\pageno=1 \hfil\else\hfil\number\pageno\hfil\fi}
\def\newpage{\vfill\eject\null\vskip10pt}
\def\problemskip{\vskip2in}
\def\newpage{\par}
\def\problemskip{\vskip12pt}

\def\threetwo#1#2#3#4#5{\par%
\threea{(a) #1}{(b) #2}{(c) #3}
\par\twothreea{(d) #4}{(e) #5}}

\def\twotwoone#1#2#3#4#5{\par%
\twoa{(a) #1}{(b) #2}
\par\twoa{(c) #3}{(d) #4}
\par\noindent\hbox to\hsize{(e)\ #5\hfill}\par}

\def\onetwooneone#1#2#3#4#5{\par%
\noindent\hbox to\hsize{(a)\ #1\hfill}\par
\twoa{(b) #2}{(c) #3}
\noindent\hbox to\hsize{(d)\ #4\hfill}\par
\noindent\hbox to\hsize{(e)\ #5\hfill}
\par}


\def\fivelines#1#2#3#4#5{\par%
\noindent\hbox to\hsize{(a)\ #1\hfill}\par
\noindent\hbox to\hsize{(b)\ #2\hfill}\par
\noindent\hbox to\hsize{(c)\ #3\hfill}\par
\noindent\hbox to\hsize{(d)\ #4\hfill}\par
\noindent\hbox to\hsize{(e)\ #5\hfill}\par
}

\def\fourone#1#2#3#4#5{\par%
\foura{(a) #1}{(b) #2}{(c) #3}{(d) #4}
\onefoura{(e) #5}}

\newcount\credit\credit=5
\newcount\pspace\pspace=1
\newcount\pc\pc=1
\hfuzz=5pt
\let\xxsum=\sum
\edef\sum{\displaystyle\xxsum}

\def\problemspacing{%
\ifcase\pspace\relax%
\null\vskip10pt\global\pspace=1 \relax\or%
\vfill\global\pspace=2 \or%
\vfill\eject\null\vskip10pt\global\pspace=1 \or%
\vfill\eject\null\vskip10pt\or
\global\pspace=3 %
\fi%%
\ifnum\pc=8 \global\pspace=4 \fi%
}

%%\def\problemspacing{\vskip10pt}
\def\newp{\problemspacing%
\noindent{\bf\number\pc.}(\number\credit\ pts.)
\global\advance\pc by1}
\def\onea#1{\noindent#1}
 \def\twoa#1#2{\noindent\hbox to\hsize{%
\hbox to.5\hsize{#1\hfil}\hbox to.5\hsize{#2\hfil}}}
 \def\stwoa#1#2{\noindent\hbox to\hsize{%
\hbox to.38\hsize{#1\hfil}\hbox to.62\hsize{#2\hfil}\hfil}}

\def\threea#1#2#3{\noindent\hbox to\hsize{%
 \hbox to.33\hsize{#1\hfil}%
\hbox to.33\hsize{#2\hfil}%
\hbox to.33\hsize{#3\hfil}%
\hfil}}
\def\twothreea#1#2{\noindent\hbox to\hsize{%
 \hbox to.33\hsize{#1\hfil}%
\hbox to.33\hsize{#2\hfil}%
\hfil}}

\def\sfivea#1#2#3#4#5{\noindent\hbox to\hsize{%
 \hbox to.17\hsize{#1\hfil}%
 \hbox to.17\hsize{#2\hfil}%
 \hbox to.17\hsize{#3\hfil}%
 \hbox to.17\hsize{#4\hfil}%
 \hbox to.32\hsize{#5\hfil}%
\hfil}}
\def\fivea#1#2#3#4#5{\noindent\hbox to\hsize{%
 \hbox to.2\hsize{#1\hfil}%
 \hbox to.2\hsize{#2\hfil}%
 \hbox to.2\hsize{#3\hfil}%
 \hbox to.2\hsize{#4\hfil}%
 \hbox to.2\hsize{#5\hfil}%
\hfil}}

\def\foura#1#2#3#4{\noindent\hbox to\hsize{%
 \hbox to.25\hsize{#1\hfil}%
\hbox to.25\hsize{#2\hfil}%
\hbox to.25\hsize{#3\hfil}%
\hbox to.25\hsize{#4\hfil}%
\hfil}}
\def\onefoura#1{\noindent\hbox to\hsize{%
\hbox to.25\hsize{#1\hfil}%
\hfil}}

\def\arcsec{{\rm arcsec}}
\def\frac#1#2{{{\textstyle#1}\over{\textstyle#2}}}
\def\smfrac#1#2{{{#1}\over{#2}}}
\def\Lim{\displaystyle\lim}
\def\Int{\displaystyle\int}


\def\frac#1#2{{\displaystyle{{\textstyle#1}\over{\textstyle#2}}}}
\def\ans#1#2#3#4#5{\par\vskip2pt\noindent\hbox to\hsize{%
(a)\ #1\hfil (b)\ #2\hfil (c)\ #3\hfil (d)\ #4\hfil (e)\ #5}\par}
\def\ansA#1#2#3#4#5{\par\vskip2pt\noindent\hbox to\hsize{%
(a)\ #1\hfil }\par\hbox to\hsize{(b)\ #2\hfil }%
\par\hbox to\hsize{(c)\ #3\hfil }
\par\hbox to\hsize{(d)\ #4\hfil }\par\hbox to\hsize{(e)\ #5\hfil}\par}

\def\ansB#1#2#3#4#5{\par\vskip2pt\noindent\hbox to\hsize{%
\hbox to .4\hsize{(a)\ #1\hfil}\hbox to .45\hsize{(b)\ #2\hfil}}%
\par\hbox to\hsize{\hbox to .4\hsize{(c)\ #3\hfil}\hbox to .4\hsize{(d)\ #4\hfil}}\par
\hbox to\hsize{(e)\ #5\hfil}\par}

\long\def\boxit#1#2{\vbox{\hrule\hbox{\vrule\kern#2
\vbox{\kern#2#1\kern#2}\kern#2\vrule}\hrule}}
\newcount\pc
\def\pr{\vskip10pt\noindent\number\pc.\global\advance\pc by 1}
\def\dd#1#2{{{\textstyle d\> #1}\over{\textstyle d#2}}}

\def\rhs#1#2{\par\noindent\hbox to\hsize{\hfill\hbox to#1{#2\hfill}}}
\def\ul#1{\vrule width#1 height -3pt depth3.1pt}
\def\UL#1#2{\hbox to0pt{\qquad #2\hss}\ul{#1}}
\newif\ifnotmarkanswers\notmarkanswerstrue
\newcount\ansmark
\def\ll#1#2{\tabalign {#1.}&
\global\ansmark=#2 \relax%
\ifnotmarkanswers \global\ansmark=0 \fi%
\ifnum\ansmark=1 \relax($\bullet$)\else(a)\fi&
\ifnum\ansmark=2 \relax($\bullet$)\else(b)\fi&
\ifnum\ansmark=3 \relax($\bullet$)\else(c)\fi&
\ifnum\ansmark=4 \relax($\bullet$)\else(d)\fi&
\ifnum\ansmark=5 \relax($\bullet$)\else(e)\fi\quad\cr}

\def\marked{\pageno=1 %
\global\notmarkanswersfalse
\headline{\vbox{\rhs{3in}{Name:\ \ul{3in}\hss}\vskip10pt%
\rhs{3in}{Instructor-section:\ \UL{2.3in}{Bullwinkle}\hss}%
\headline{XX}
}}
\answersheet}


\def\+{\tabalign}
\long\gdef\xexam#1#2{%
\pc=1 \pageno=1 \pspace=0 %
\headline{\vbox{\rhs{3in}{Name:\ \ul{3in}\hss}\vskip10pt%
\rhs{3in}{Instructor-section:\ \UL{2.3in}{#1}\hss}%
}}
\headline{\hfill}
\def\xyyxx##1 @{\gdef\xyxy{##1}}
\long\gdef\answersheet{
\expandafter\xyyxx\rightanswers  @
\def\blank{}%
\ifx\xyxy\blank\relax\else
\null\vskip10pt
\centerline{\bf \tT}
\centerline{\ddd}
\vskip10pt

\itemitem{$\bullet$}
The Honor Code is in effect for this examination.
All work is to be your own.
\itemitem{$\bullet$} No calculators.
\itemitem{$\bullet$} The exam lasts for one hour.
\itemitem{$\bullet$} Be sure that your name is on every page in case
pages become detached. 
\itemitem{$\bullet$} Be sure that you have all 11 pages of the test.
\vskip10pt
\centerline{Good Luck!}
\vskip4pt
\def\HH{\hskip.8in}
{\bf Please mark your answers with an X.}\par
\settabs\+9.\qquad &\HH&\HH&\HH&\HH&\HH&\cr
\boxit{\vbox{{\obeylines\baselineskip20pt
\rightanswers
}}}{10pt}
%%\vskip10pt
\settabs\+Total multiple choice: &\hskip 2in\cr
\hfill{{\vbox to0pt{\boxit{\vbox{\obeylines\hsize=3in\baselineskip26pt
\noindent{\bf Do not write in this box!}
\tabalign Total multiple choice: &\quad\ul{1in}\cr
\tabalign\hfill11.&\quad\ul{1in}\cr
\tabalign\hfill12.&\quad\ul{1in}\cr
\tabalign\hfill13.&\quad\ul{1in}\cr
\tabalign\hfill14.&\quad\ul{1in}\cr
\tabalign\hfill15.&\quad\ul{1in}\cr

\tabalign\hfil {\bf Total:}&\quad\ul{1in}\cr
}}{10pt}\vss}}}\fi}
%%\long\gdef\finalanswersheet{
\long\gdef\answersheet{
\expandafter\xyyxx\rightanswers  @
\def\blank{}%
\ifx\xyxy\blank\relax\else
\null\vskip10pt
\centerline{\bf \tT}
\centerline{\ddd}
\vskip10pt

\itemitem{$\bullet$}
The Honor Code is in effect for this examination.
All work is to be your own.
\itemitem{$\bullet$} No calculators.
\itemitem{$\bullet$} The exam lasts for two hours.
\itemitem{$\bullet$} Be sure that your name is on every page in case
pages become detached. 
\itemitem{$\bullet$} Be sure that you have all 13 pages of the test.
\vskip10pt
\centerline{Good Luck!}
\vskip4pt
\def\HH{\hskip.8in}
{\bf Please mark your answers with an X.}\par
\settabs\+9.\qquad &\HH&\HH&\HH&\HH&\HH&\cr
\boxit{\vbox{{\obeylines\baselineskip20pt
\rightanswers
}}}{10pt}\fi
}
\answersheet
\vfill\eject\null\vskip10pt
#2}

\long\def\print#1{\xexam{#1}{\xxxam}}
\long\def\exam#1{\gdef\xxxam{#1}}