Difference between revisions of "CSC103 2011 Take-Home Final Exam 2"

From dftwiki3
Jump to: navigation, search
(Problem #3: Javascript (40 points))
 
(5 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
</center-->
 
</center-->
  
 
+
<onlydft>
 
<tanbox>
 
<tanbox>
 
This final exam is take-home. It is open-books, open-notes, and open-Web. It is due a week after it is made available, at '''noon''' on Friday April 22nd, 2011.
 
This final exam is take-home. It is open-books, open-notes, and open-Web. It is due a week after it is made available, at '''noon''' on Friday April 22nd, 2011.
Line 71: Line 71:
 
   document.write( "*" );
 
   document.write( "*" );
  
and displays the generate the following output:
+
and displays the following output:
  
 +
<source lang="text">
 
  **********
 
  **********
 
   *********
 
   *********
Line 83: Line 84:
 
         **
 
         **
 
           *
 
           *
 
+
</source>
 
Note that there are 10 lines, and each line contains a decreasing number of stars.  The first line contains 10 stars, the second 9 stars, etc.
 
Note that there are 10 lines, and each line contains a decreasing number of stars.  The first line contains 10 stars, the second 9 stars, etc.
  
Line 92: Line 93:
 
Remember that all the stars must be printed by only one document.write() statement that prints only one star: '''document.write( '*' )'''.  You may have additional document.write() statements, but these cannot print stars.
 
Remember that all the stars must be printed by only one document.write() statement that prints only one star: '''document.write( '*' )'''.  You may have additional document.write() statements, but these cannot print stars.
  
Note that to HTML "absorbs" space characters by default.  So if you want to print spaces that are not absorbed you can print the special character "&nbsp;", as follows:
+
Note that to HTML "absorbs" space characters by default.  So if you want to print spaces that are not absorbed you can print the special character "&amp;nbsp;", as follows:
  
     document.write( "&nbsp;" );
+
     document.write( "&amp;nbsp;" );
  
  
Line 106: Line 107:
 
* Make sure you write your name at the top of the document.
 
* Make sure you write your name at the top of the document.
 
* Submit your pdf file as an attachment of a message you will mail to 103b@cs.smith.edu, with the subject '''final exam'''
 
* Submit your pdf file as an attachment of a message you will mail to 103b@cs.smith.edu, with the subject '''final exam'''
 
+
<br />
 
<br />
 
<br />
 
<br />
 
<br />
 
<br />
 
<br />
 
<br />
 
<br />
<br />
+
</onlydft>
 
 
  
  

Latest revision as of 10:19, 2 September 2017

--D. Thiebaut 22:47, 14 April 2011 (EDT)



...