Quiz 6: EECS 101
  1. (5 points) Write a JavaScript function makeString(char,len) which returns a string consisting of len chars. For example,

    makeString("a",3)  returns "aaa"
    makeString("7",11) returns "77777777777"
    
    You may assume that char is a single character and that len is a valid positive integer.
    function makeString(newChar,length) {
    	var newString = "";
    	for (var i=0; i < length; i++) {
    		newString += newChar;
    	}
    	return newString;
    }
    
  2. (2 points) If I begin in the UNIX directory
    /home/usr/alpha/beta/gamma
    
    what directory am I in if I type the following UNIX commands:
    cd ..
    cd gamma
    cd ..
    cd ..
    cd beta
    cd ..
    
    /home/usr/alpha

  3. (3 points) Briefly describe the function of the following UNIX commands: ls, cp, cat.

    ls
    lists the contents of a directory
    cp
    copies a file (or directory)
    cat
    concatenates and displays the contents of a file (on standard output)