C. S. 140    
    H. N. Riley
    Fall, 1999   

Lab Exercise A
Thursday, October 7

This lab exercise is to be done during the class period on Thursday.

 

Following the instructions and suggestions given in Chapter 2 of the CS 140 Handbook, do at least the following:

 

 1)        Log on to the SPARC.

 

 2)        Create a short file of text data using the “cat” command.

 

 3)        Display the content of the file that you created using “cat.”

 

 4)        Use “ls” to see the names of your files.

 

 5)        Use the “man” command to find out more about the two previous commands and about “man.”

 

 6)        Repeat steps 2 through 4 two or three times.

 

 7)        Ask the SPARC what today’s date is (the “date” command).

 

 8)        Find out who is using your SPARC (“who”).

 

 9)        Send a “mailx” message to the person next to you.

 

10)       Send a mailx message to me (hnriley).  Include the following information:

                        The most interesting thing you have learned in CS 140 so far.

                        The names of the persons on either side of you.

                        Five adjectives that describe this lab exercise.

            I will reply to your message (not necessarily during the lab).  If you don’t get a reply, something went wrong, so let me know.

 

11)       Log off and log back on again one or more times.

 

 


    C. S. 140    
    H. N. Riley
    Fall, 1999   

Lab Exercise B
Thursday, October 14

This lab exercise will be done during the class period on Thursday.  Class will be held in the lab.

 

Following the instructions and suggestions given in Chapter 3 of the CS 140 Handbook and/or in class, do at least the following:

 

 1)        Log on to the SPARC.

 

 2)        Display the content of  /dfs/user/hnriley/words.dat

 

 3)        Copy that file into your directory and give your copy the name words.dat.  Display your copy.

 

 4)        Make a second copy of the words file and call it  wordsx.txt.  Make another copy and call it  wordsy.txt.

 

 5)        Display the protection codes for your file  wordsy.txt.  Change the codes a time or two and display the new protections.

 

 6)        Display the list of files in your directory.  Use the wild cards (both kinds) to see their effect.  Delete the  wordsy.txt  file and display your directory again to show that it is no longer there.

 

 7)        Use the vi editor to edit the file words.dat as explained in the Handbook to get one word per line, left justified (first letter in “column 1”).  Don’t add, delete or change any words.

 

 8)        Sort the file  words.dat.  Display the result using more instead of cat.  Check to see that the words are in alphabetical order.  Do a word count to see that you didn’t lose any.

 

 9)        Rename the sorted file as  wordsfile.txt  and permit it according to the instructions.

 

10)       Copy the file  /dfs/user/hnriley/sample.txt  and edit it in accordance with the instructions contained within it.  When finished, rename this file as  better.txt  and permit it according to the instructions.  Check the permissions on both permitted files.

 

 

11)       Explore all the other commands mentioned in Chapter 3 of the Handbook.

 

 


    C. S. 140    
    H. N. Riley
    Fall, 1999   

Lab Exercise C
Thursday, October 21

This lab exercise will be done during the class period on Thursday.  Class will be held in the lab.

 

Following the instructions and suggestions given in Chapter 4 of the CS 140 Handbook and/or in class, do at least the following:

 

 1)        Log on to the SPARC.

 

 2)        Copy the file  /dfs/user/hnriley/Example.java  into your account.

 

 3)        Display that Java program on your terminal screen.

 

 4)        Compile and execute the program.

 

 5)        Add statements to the program that will cause it to display your name, an observation on the weather, and the name of your favorite vegetable--each on a separate line.  Compile and run this expanded version.

 

 6)        Run this new program again and redirect the output to a file named  example_out.txt.

 

 7)        Display that output file.  If it is correct, permit the two files (the new program and the output file) to hnriley as previously instructed.

 

 8)        Copy the file  /dfs/user/hnriley/Name_Tag.java.  Then compile and run it with your name as a command line argument.

 

 9)        Change the name tag program so that it takes an additional argument and displays two lines.  Compile and run it.  Run it again, redirecting the output to a file named nametag_out.txt.  Check the content of the file.  Permit the new program and the output file as previously instructed.

 

10)       Print the file nametag_out.txt on the lab printer.  Turn in that output (a single page) to the instructor.

 

11)       Check the permissions on:

                        Example.java                example_out.txt

                        Name_Tag.java            nametag_out.txt

 

12)       Practice using the editor, the compiler, and the interpreter.


    C. S. 140    
    H. N. Riley
    Fall, 1999   

Lab Exercise D
Thursday, October 28

This lab exercise will be done during the class period on Thursday.  Class will be held in the lab.

 

Following the instructions and suggestions given in Chapter 5 of the CS 140 Handbook and/or in class, do at least the following:

 

 1)        Use the editor to create a file Avtemp.java and type in the program Avtemp from the Handbook.  Use the “styled” version, and follow those style rules in entering the program.

 

 2)        Change the author’s name from A. Student to your name, and put today’s date in another comment.  Add a statement to print your name in the output.

 

 3)        Compile the program.  (Correct any typing errors you made.)

 

 4)        Run the program and enter the following data:

 

                        68, 72, -10, 73, 212, 60, 500, 64, 67, 32, 0, 71, 9999

 

            Did you get the correct result?

 

 5)        If so, then run the program again redirecting the output to a file avtemp_out.txt.

 

 6)        Permit the two files, Avtemp.java and avtemp_out.txt as before.

 

 7)        Start on Project 1.