The userID and password for the CS Department's machines are not the same as your NetID and password. The userId is normally the first letter of your first name and upto seven letters of your last name. If you are not a CS major, you may end up with a "temp" account. The temp accounts have the userId begin with the 4 letters "temp" and end with some number. To find out your exact userID, there are lists posted in the CS Lab stating everyone's userID and name. The default password for the CS account is your UIN.
End your connection to UNIX. It is very important to disconnect when you are finished so no one else can come along after you and use your account.
List the contents of the current directory. Note: a UNIX directory is the same as a Windows folder.
The ls command has a special usage that will give more information about the files in the current directory. This is the long listing. This uses the -l option to the ls command:
ls -lThe first thing given on the long listing is the permissions for each file. This is important when making web pages viewable on the internet.
Allows the contents of file in <filename> to be changed. The editor pico is the counter part to the email reader pine. The ACCC's web page combine these two programs together under the name of pine. For a web page with a description of pico and how to use it, check out the North Carolina State Pico Page or the University of South Dakota Pico Page.
Change to the directory given in <directoryName>. This command is normally used to change to a sub-directory of the current directory (change one level down in the hierarchical file system).
The cd command has two special usages. These are:
By just typing in cd, you will change back to your Home directory from where ever you are at in the hierarchical file system. Your Home directory is the directory you are in when you first log onto the UNIX system.
This command will move you up one level in the hierarchical file system. The directory that is one level up from the current directory is referred to as the parent directory of the current directory.
This command allows the user to change the password to log onto the CS account. It is strongly recommended to change your password from the default password of your UIN.
Display the contents of the file indicated by <filename> to the screen.
Display the contents of the file indicated by <filename> to the screen one page at a time.
Creates a duplicate of the file in <filename1> with the name <filename2>.
Renames the file in <filename1> with the name <filename2>.
Deletes the file in <filename> from the current directory. Note: once a file is deleted is cannot be restored. So use this command with caution!
Sends the file in <filename> to be printed at the printer with name <printerName>. This command also has a ACCC web page describing its use. Note: The lpr command will assume the file is stored using the ASCII character format (i.e. plain text). So don't try to print files that are not plain text.
The actual command stands for Present Working Directory. This command will list the full path name of the current directory. Each slash in the full path name represents one level in the hierarchical file system.
List the contents of the current directory. Note: a UNIX directory is the same as a Windows folder.
This command will create a new directory with the name indicated by <directoryName> as a sub-directory of the current directory.
This command will remove/erase the directory with the name indicated by <directoryName> that is an existing sub-directory of the current directory. Note, the sub-directory must be empty (contain no files or other directories) before it can be removed.
~i101/setupDrJavaOnly enter the above command once.
After the bookClasses directory has been set up, enter the following command to start DrJava:
~i101/runDrJavaOnce DrJava is up and running, it should work the same as it has on the ACCC's windows machine. Actually is should work better. At least, it will run faster.
For this lab assignment, complete the following:
To get the user's input, we will use the getIntNumber() method of the SimpleInput class. The SimpleInput class is one of the classes in the bookCAlasses directory. This method will display a "pop-up" window that will prompt the user to enter an integer value.
The getIntNumber() has two ways it can be used. In either way, it takes a String parameter will be displayed as a message when the user is prompted for the input. That is the only parameter for the first way that getIntNumber() can be used. The other way also takes two more parameter which specify the range the number enter by the user must be in. The following code shows both of these ways.
// declare in integer variable to store the number entered by the user. int value; // prompt the user for the number value = SimpleInput.getIntNumber ("Please enter an integer value."); // display the value entered by the user System.out.println ("The user entered: " + value); // prompt the user for a number within a range of values value = SimpleInput.getIntNumber ("Please enter an integer value between 1 and 10.", 1, 10); // display the value entered by the user System.out.println ("The user entered: " + value); |
For this lab, you can use either form of the getIntNumber() method that you want. If probably makes sense to use second version of the method. The lower number in the range should be one. Values less than one don't really make any sense. (Perhaps the value of zero could make sense, if you wanted to run the program that didn't do any modifications to the image. But then why run the program at all?) The upper number in the range could be somewhere around 10, because running brighten() on a color too many times will result in a pure white (or nearly pure white) image.
Your program must prompt the user for the image file to use (as was done in the code in Lect925a.java), prompt the user for the number of times to brighten the image, brighten the image as specified by the user, prompt the user for another filename in which the resulting image could be stored (as was done in the code in Lect925a.java).
turnin -c cs101 -p lab6 lab6.javaTo verify what you submitted using the turnin command, type:
turnin -c cs101 -p lab6 -v