Assignment 1, due Jan 20Solutions
Part of
the homework for CS:2820, Spring 2017
|
if i < 3, f( i ) = i
otherwise f( i ) = f( i – 1 ) + f( i – 3 )
A Question: Give the values of f(0) through f(9). (1.0 point)
f(0) = 0
f(1) = 1
f(2) = 2
f(3) = 2
f(4) = 3
f(5) = 5
f(6) = 7
f(7) = 10
f(8) = 15
f(9) = 22
Use your account to sign in to linux.cs.uiowa.edu using either an SSH client or FastX
You can get to FastX with the following link:
— http://fastx.divms.uiowa.edu
Note that FastX just opens a remote Linux desktop. If you use the XFCE
desktop, you can open a terminal window to get to the same command line
interface that you use with an SSH session.
To make an SSH connection directly from a Mac
or Linux system, open a terminal window locally (terminal is an
application, a system utility), then type this command
ssh linux.cs.uiowa.edu -l HawkID
with your own HawkID substituted for HawkID in the command.
Access from off-campus requires an additonal parameter. We will discuss this
in class.
It is almost as easy from a PC, where you must
launch either the PuTTY or SecureCRT application
and then fill in a form with the system name and HawkID.
For additional guidance, see:
—
http://www.divms.uiowa.edu/clas_linux/help/start/remote.html
A question:
Use a shell window on the CS Linux machine. Type the following
command:
[HawkID@serv16 ~]$ ~dwjones/object
(Boldface in the above is the command you type, non-bold is the prompt
from the system; type the requested text verbatim, do not change a thing.)
Report the output you got.
If you did not make it all the way to the point where you could
do the above, report how far you got.
(1 point)
The expected output was something like this:
CS:2820 welcome script for HawkId, Thu Jan 26 14:02:09 CST 2017.
Unfortunately, due to a change made by the system administrators without informing the faculty, the HawkId was omitted for newly created Linux accounts.
88 people ran this script. The script was run 177 times, so many students ran it many times.
A question: What is it? (do not copy it, tell what it in just a few words.)
The long block quotation is the copyright notice that applies to all of the the code given in the the book's web site.