Difference between revisions of "CSC103 Take-Home Exam 2013"
Line 155: | Line 155: | ||
Submit everything on paper. You may type or neatly hand-write your answers, including the Processing sketch. | Submit everything on paper. You may type or neatly hand-write your answers, including the Processing sketch. | ||
</onlydft> | </onlydft> | ||
+ | |||
<br /> | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <!-- ---------------------------------------------------------------------------------------------------- --> | ||
+ | <onlydft> | ||
+ | =Solution for Processing= | ||
+ | <br /> | ||
+ | <source lang="java"> | ||
+ | void setup() { | ||
+ | size( 500, 500 ); | ||
+ | smooth(); | ||
+ | } | ||
+ | |||
+ | void draw() { | ||
+ | if ( mousePressed ) { | ||
+ | background( 255 ); | ||
+ | } | ||
+ | textSize( 32 ); | ||
+ | fill( 0, 102, 153 ); | ||
+ | text( "CSC103 How Computers Work 2013", | ||
+ | width/2+10, height/2, | ||
+ | width/2-10, height/2 -10 ); | ||
+ | |||
+ | if ( mouseX < width/2 ) { | ||
+ | fill( 200, mouseY/2, 50 ); | ||
+ | ellipse( mouseX, mouseY, mouseX/3, mouseX/3 ); | ||
+ | } | ||
+ | else { | ||
+ | fill( mouseX/2, 200, 50 ); | ||
+ | rect( mouseX, mouseY, 30, 30 ); | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | |||
+ | |||
+ | |||
[[Category:CSC103]][[Category:Exam]] | [[Category:CSC103]][[Category:Exam]] |
Revision as of 15:49, 8 October 2013
--D. Thiebaut (talk) 10:06, 25 September 2013 (EDT)
This exam will be a one-week take-home exam and will be released on 10/10/13. It is given under the rules of the Smith College Honor Code, and the work your turn in must reflect your individual work on this exam. You cannot discuss any of the details of this exam with anybody except me, your instructor (D. Thiebaut). If you have a question, please post it to Piazza, and make it private to your instructor only. I will answer it and make it public if I think everybody would benefit from the question and its answer. Piazza wil/should send you an update, or an email right away when something is posted, depending on how you set your profile. Questions will NOT be answered in person outside the last class time. The reason for this is to make sure everybody gets the same information from questions. Piazza is therefore the only system for you to ask questions.
The exam is due on 10/17/13, at 9:00 a.m.
<onlydft>
Solution for Processing
void setup() {
size( 500, 500 );
smooth();
}
void draw() {
if ( mousePressed ) {
background( 255 );
}
textSize( 32 );
fill( 0, 102, 153 );
text( "CSC103 How Computers Work 2013",
width/2+10, height/2,
width/2-10, height/2 -10 );
if ( mouseX < width/2 ) {
fill( 200, mouseY/2, 50 );
ellipse( mouseX, mouseY, mouseX/3, mouseX/3 );
}
else {
fill( mouseX/2, 200, 50 );
rect( mouseX, mouseY, 30, 30 );
}
}