Assignment 1, due Aug 25

Solutions

Part of the homework for CS:2820, Fall 2017
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

  1. A test of your understanding of the prerequisites: Consider this recursive integer function. All operators here are integer operations. This is an informal mathematical definition; it is not coded in a programming language:

    if i < 2, f( i ) = i
    otherwise f( i ) = i + (i – 1) + f( i – 1 )

    A Question: Give the values of f(0) through f(9). (1.0 point)

      i    f(i)  
    00
    11
    24
    39
    416
    525
    636
    749
    864
    981

  2. Background: In the introduction to the Eckel's textbook, he says what version of Java he uses.

    A question: What version is this? This is a scavenger hunt question to get you to look at the text.

    Java SE 5/6

  3. Background: If you do not have a CLAS Linux account, create one. The instructions are here:
      — http://www.divms.uiowa.edu/clas_linux/
    Follow the instructions there for "Create a CLAS Account". Note that this is easier from on campus, for example, in one of the Information Technology Centers, because if you are off campus, you will have to tunnel through the University's firewall using a VPN. (The link for how to set that up is there too, but it will take time, so don't let the VPN issue slow you down.)

    Use your account to sign in to linux.cs.uiowa.edu using FastX. The following link takes you to FastX:
      — http://fastx.divms.uiowa.edu
    FastX opens a remote Linux desktop. The MATE desktop has an icon at the top to let you open a command line shell interface in the a terminal window.

    When it is time to end your session, the exit shell command will close your terminal window. To close your FastX session and log out of Linux, click on the LogOut button in the System pull-down menu on your Linux desktop.

    For additional guidance, see:
      — http://www.divms.uiowa.edu/clas_linux/help/start/remote.html

    A question: Use a shell window on a CLAS 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)

    Time will be provided in the discussion section to help those who have trouble with this. The rest of time will be spent demonstrating the Java hello-world program on the CLAS Linux system.

    The following is a transcript produced by me solving the problem. Your result will have included your HawkID and the time and date you solved the problem. It also made a log entry in my log file.
    [dwjones@serv15 ~]$ ~dwjones/object
    On Mon Aug 28 21:40:15 CDT 2017, dwjones completed CS:2820 assignment 1.
    [dwjones@serv15 ~]$