Brandon R. Rodriguez https://www.csteachingtips.org/ en Give students a fully functional program on Day 1 that they will incrementally add features to as you cover content throughout the semester to engage them by satisfying their desire for creating working code. https://www.csteachingtips.org/tip/give-students-fully-functional-program-day-1-they-will-incrementally-add-features-you-cover <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Give students a fully functional program on Day 1 that they will incrementally add features to as you cover content throughout the semester to engage them by satisfying their desire for creating working code.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-05-25T16:32:42-07:00" title="Monday, May 25, 2015 - 16:32" class="datetime">Mon, 05/25/2015 - 16:32</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/give-students-fully-functional-program-day-1-they-will-incrementally-add-features-you-cover" data-a2a-title="Give students a fully functional program on Day 1 that they will incrementally add features to as you cover content throughout the semester to engage them by satisfying their desire for creating working code."><a class="a2a_button_facebook"><span class="a2a_label">Share Give students a fully functional program on Day 1 that they will incrementally add features to as you cover content throughout the semester to engage them by satisfying their desire for creating working code. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Give students a fully functional program on Day 1 that they will incrementally add features to as you cover content throughout the semester to engage them by satisfying their desire for creating working code. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>This allows students to practice new concepts they’ve learned on a program they can show off without having to know how all the pieces fit together right away.</li> <ul><li>Students also gain practice working with code created by other programmers.</li></ul><li>Before class starts, prepare a program for students to iteratively add to. </li> <ul><li>Games work very well.</li> <ul><li>Rodriguez found Snake to be particularly effective. </li></ul><li>Make sure your program works out-of-the-box. </li> <ul><li>Your game should execute, but it should be a "bare bones" implementation.</li> <ul><li>A bare-bones implementation of Snake might simply draw a List of squares on the screen and let you move the snake by hitting the directional arrow keys.</li></ul><li>Students should be able to run the game without any errors and be able to interact with it at basic level.</li></ul><li>As you cover topics in class, return to the game and add new features.</li> <ul><li>These will be mini-assignments throughout the semester for students to implement themselves. </li> <li>Students get to focus exclusively on applying knowledge from a specific lesson because the overall structure of the program is already provided. </li> <ul><li>Not needing to worry about the overhead of user interface (UI), drawing, class design, and other concepts not yet covered keeps students from becoming overwhelming. </li></ul></ul><li>Examples of enhancements to a Snake game include:</li> <ul><li>Adding an integer variable to keep track of the score as the snake eats food <b>(Variables)</b>.</li> <li>Extending the food class to make new types of food <b>(Inheritance)</b>.</li> <ul><li>Food that makes your snake fast, by alters the speed of the snake.</li> <li>Food that makes your snake slow.</li> <li>Food that changes the color of your snake, rainbow food.</li> <li>Food that changes the direction of your snake, where the head becomes the tail.</li> <li>Food that moves your snake to a random location.</li> </ul></ul><li>Make the snake grow longer when it eats food <b>(List Manipulation)</b>.</li> <ul><li>Add an item to the List, or the other data structure being used to represent the snake when the snake eats food.</li></ul></ul></ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Mon, 25 May 2015 23:32:42 +0000 cstt 695 at https://www.csteachingtips.org Require students to refactor their code while keeping the output of their program exactly the same in order to challenge them to solve problems using a variety of strategies. https://www.csteachingtips.org/tip/require-students-refactor-their-code-while-keeping-output-their-program-exactly-same-order <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Require students to refactor their code while keeping the output of their program exactly the same in order to challenge them to solve problems using a variety of strategies.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-04-29T16:18:31-07:00" title="Wednesday, April 29, 2015 - 16:18" class="datetime">Wed, 04/29/2015 - 16:18</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/require-students-refactor-their-code-while-keeping-output-their-program-exactly-same-order" data-a2a-title="Require students to refactor their code while keeping the output of their program exactly the same in order to challenge them to solve problems using a variety of strategies."><a class="a2a_button_facebook"><span class="a2a_label">Share Require students to refactor their code while keeping the output of their program exactly the same in order to challenge them to solve problems using a variety of strategies. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Require students to refactor their code while keeping the output of their program exactly the same in order to challenge them to solve problems using a variety of strategies. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>This is a great technique to get students out of their comfort zones and working on creative problem solving.</li> <li>If students get stuck, provide them with some of the following suggestions for modifying their code:</li> <ul><li>Change for-loops to while-loops.</li> <li>Convert arrays to ArrayLists.</li> <li>Change Strings to character arrays.</li> </ul><li>Tell students that certain data structures or data types cannot be used.</li> <ul><li>This added helps them figure out how to change their code without changing their output.</li> <li>For instance, disallow use of the multiplication (*) operator.</li> <ul><li>This forces students to think about how to implement a multiply() function and get creative.</li> <ul><li>Students can use a for-loop or recursive addition. Give them a chance to figure it out on their own and be creative.</li> </ul></ul></ul></ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Wed, 29 Apr 2015 23:18:31 +0000 cstt 693 at https://www.csteachingtips.org Track the variable values of a recursive function using multiple pieces of paper to form a “stack” so that students can visualize what happens when a method calls itself and how each method call has its own unique variable values. https://www.csteachingtips.org/tip/track-variable-values-recursive-function-using-multiple-pieces-paper-form-stack-so-students-can <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Track the variable values of a recursive function using multiple pieces of paper to form a “stack” so that students can visualize what happens when a method calls itself and how each method call has its own unique variable values.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-04-18T16:22:49-07:00" title="Saturday, April 18, 2015 - 16:22" class="datetime">Sat, 04/18/2015 - 16:22</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/track-variable-values-recursive-function-using-multiple-pieces-paper-form-stack-so-students-can" data-a2a-title="Track the variable values of a recursive function using multiple pieces of paper to form a “stack” so that students can visualize what happens when a method calls itself and how each method call has its own unique variable values."><a class="a2a_button_facebook"><span class="a2a_label">Share Track the variable values of a recursive function using multiple pieces of paper to form a “stack” so that students can visualize what happens when a method calls itself and how each method call has its own unique variable values. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Track the variable values of a recursive function using multiple pieces of paper to form a “stack” so that students can visualize what happens when a method calls itself and how each method call has its own unique variable values. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>Using a physical stack of papers as the stack help students visualize how the recursive function "pops off" the stack and returns a value to the previous function call.</li> <li>Activity Prep:</li> <ul><li>Print out a simple recursive function, each student will need multiple copies of the function.</li> <li>Factorial is a good function to start with, using the code print each student 5 copies so they can trace through <code>factorial(5)</code>:</li></ul></ul><code>public int factorial(int n) {    // The value of n is: ____    if (n == 1) {     return 1;    }   // This line says: ____ * factorial(____)    return n * factorial(n - 1);    // factorial(n - 1) ended up returning the value ____   // This method will return the value ____ }</code> <ul><li>Activity:</li> <ul><li>Provide each student with five pieces of paper with the factorial function printed on it.</li> <ul><li>Ask students to trace <code>factorial(5)</code>;</li></ul><li>Have students trace through <code>factorial(5)<code>:</code></code></li> <ul><li>They begin by filling in the initial condition, "The value of n is <strong>5</strong>."</li> <li>Each time the function calls itself students</li> <ul><li>(a) mark where code execution was interrupted by the recursive call by drawing a line.</li> <li>(b) grab a new copy of the function to put "on the stack"</li> <ul><li>Students place the recursive call on the stack by placing the new copy on top of the previous copy of the function.</li></ul></ul><li>Students continue to trace through the code until a base case is reached.</li> <li>Once a base case is reached:</li> <ul><li>Students "pop" the most recent method call off the stack by removing the top copy of the function and using its return value.</li> <li>Students should resume execution where they drew a line in the code.</li> <li>Students will continue to do this until they’ve successfully completed executing <code>factorial(5)</code>, filling in the value it returns.</li></ul></ul></ul><li>Note: This activity can get confusing if using a recursive function that calls itself more than once (e.g. <code>fibonacci(n - 1) + fibonacci(n - 2)</code>).</li> <ul><li>After using a simple recursive call, like factorial, you can have students advance to more complicated recursive functions.</li> <li>Numerical comma insertion method (turn 7000000 into 7,000,000) is a good segue between the simple factorial example and the more complicated Fibonacci example.</li> <ul><li>Below are two different versions of recursive comma insertion methods you can use, simply add comments for students to fill in when they trace through them.</li> <li>Note that the <code>insertCommas()</code> function includes several local variables for students to track as well as the argument that was passed in.</li></ul></ul></ul><code> // Parameter is a String for this version. public String insertCommas(String number) {   int size = number.length();   if (size &lt; 4) {     return number;    } else {     String numberWithComma = "," + number.substring(size - 3, size);     String leftPartOfNumber =        Integer.toString(Integer.parseInt(number) / 1000);     return insertCommas(leftPartOfNumber) + numberWithComma;    } }</code> <code> // Parameter is an Int for this version public String insertCommas(int number) {   if (n </code></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Sat, 18 Apr 2015 23:22:49 +0000 cstt 660 at https://www.csteachingtips.org Show code without inheritance before showing code that uses inheritance so that students create a tacit understanding of the benefits inheritance provides. https://www.csteachingtips.org/tip/show-code-without-inheritance-showing-code-uses-inheritance-so-students-create-tacit <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Show code without inheritance before showing code that uses inheritance so that students create a tacit understanding of the benefits inheritance provides.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-01-31T16:13:48-08:00" title="Saturday, January 31, 2015 - 16:13" class="datetime">Sat, 01/31/2015 - 16:13</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/show-code-without-inheritance-showing-code-uses-inheritance-so-students-create-tacit" data-a2a-title="Show code without inheritance before showing code that uses inheritance so that students create a tacit understanding of the benefits inheritance provides."><a class="a2a_button_facebook"><span class="a2a_label">Share Show code without inheritance before showing code that uses inheritance so that students create a tacit understanding of the benefits inheritance provides. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Show code without inheritance before showing code that uses inheritance so that students create a tacit understanding of the benefits inheritance provides. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>For example, when teaching inheritance in Java using Shape classes, developed a basic framework for displaying shapes and provided this for students.</li> <ul><li>Two classes Rodriguez created, Square1.java and Circle1.java, must have instance variables.</li> </ul><li>Later we introduce a parent class, Shape.java, which allowed us to write Square.java and Circle.java, which both extended Shape.java.</li> <li>Providing the code that didn’t use the inheritance first was important so students could see a concrete example of what the inheritance was trying to accomplish.</li> <li>Check out <a href="https://drive.google.com/folderview?id=0B0w0E8XhbH4ULVp5WENSVU1wRXc&amp;usp=sharing">all the files Rodriguez used for this assignment</a>.</li> <ul><li>Circle1 (which uses instance variables) and Circle.java (which uses inheritance) are shown below:</li> </ul></ul><p><code><br /> // Circle1.java<br /> // Written by Brandon Rodriguez<br /> import java.awt.Color;</code></p> <p>public class Circle1 {<br /> private int radius;<br /> private int x;<br /> private int y;<br /> private Color color;</p> <p> public Circle1(int r, int x, int y) {<br /> radius = r;<br /> this.x = x;<br /> this.y = y;<br /> color = Color.RED;<br /> }</p> <p> public double getPerimeter() {<br /> return 2 * Math.PI * radius;<br /> }</p> <p> public double getArea() {<br /> double area = Math.PI * radius * radius;<br /> return area;<br /> }</p> <p> public int getRadius() {<br /> return radius;<br /> }</p> <p> public int getX() {<br /> return x;<br /> }</p> <p> public int getY() {<br /> return y;<br /> }</p> <p> public Color getColor() {<br /> return color;<br /> }<br /> }</p> <p>// Circle.java<br /> // This file extends Shape.java<br /> // Written by Brandon Rodriguez<br /> import java.awt.Color;<br /> import java.awt.Graphics;</p> <p>public class Circle extends Shape {<br /> private int radius;</p> <p> public Circle(int r, int x, int y) {<br /> radius = r;<br /> this.x = x;<br /> this.y = y;<br /> color = Color.RED;<br /> }</p> <p> public void draw(Graphics g) {<br /> g.setColor(color);<br /> g.drawOval(x, y, 2*radius, 2*radius);<br /> g.fillOval(x, x, 2*radius, 2*radius);<br /> }</p> <p> public double getPerimeter() {<br /> return 2 * Math.PI * radius;<br /> }</p> <p> public double getArea() {<br /> double area = Math.PI * radius * radius;<br /> return area;<br /> }<br /> }<br /></p> </div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Sun, 01 Feb 2015 00:13:48 +0000 cstt 414 at https://www.csteachingtips.org Introduce a (sometimes silly) back-story for why students need to write particular methods to motivate them and see how their work might be needed in industry jobs. https://www.csteachingtips.org/tip/introduce-sometimes-silly-back-story-why-students-need-write-particular-methods-motivate-them <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Introduce a (sometimes silly) back-story for why students need to write particular methods to motivate them and see how their work might be needed in industry jobs.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-01-31T16:10:32-08:00" title="Saturday, January 31, 2015 - 16:10" class="datetime">Sat, 01/31/2015 - 16:10</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/introduce-sometimes-silly-back-story-why-students-need-write-particular-methods-motivate-them" data-a2a-title="Introduce a (sometimes silly) back-story for why students need to write particular methods to motivate them and see how their work might be needed in industry jobs."><a class="a2a_button_facebook"><span class="a2a_label">Share Introduce a (sometimes silly) back-story for why students need to write particular methods to motivate them and see how their work might be needed in industry jobs. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Introduce a (sometimes silly) back-story for why students need to write particular methods to motivate them and see how their work might be needed in industry jobs. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>For example, when creating a rectangle class, tell students that the company you work for isn’t happy with the existing Java Rectangle class and it needs new functionality such as getArea().</li> <ul><li>If some students are interested in making video games, show them how hey could make an animated rectangle, to show how what they’re doing connects to making video games.</li> </ul><li>File I/O isn’t on the AP guidelines, but consider introducing it anyway as students may be curious about saving a "high scores" list in a video game.</li> <ul><li>Tell students that Google wants to know the frequencies of the letters in a book, and which letter of the alphabet is most popular so they can display the answers in search results.</li> <ul><li>You’ll need to find a short book as a text file online for this activity.</li> <li>Have students create a program to read through the book and count the frequencies of each letter.</li> <li>This is a relatively boring task, but with the backstory students become interested and the task is suddenly exciting.</li> </ul></ul></ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Sun, 01 Feb 2015 00:10:32 +0000 cstt 413 at https://www.csteachingtips.org Have students compete calculating to the 50th Fibonacci number, one team of humans doing the math versus a team students writing a program to stress the importance of computing for calculations. https://www.csteachingtips.org/tip/have-students-compete-calculating-50th-fibonacci-number-one-team-humans-doing-math-versus-team <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Have students compete calculating to the 50th Fibonacci number, one team of humans doing the math versus a team students writing a program to stress the importance of computing for calculations. </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-01-31T16:07:29-08:00" title="Saturday, January 31, 2015 - 16:07" class="datetime">Sat, 01/31/2015 - 16:07</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/have-students-compete-calculating-50th-fibonacci-number-one-team-humans-doing-math-versus-team" data-a2a-title="Have students compete calculating to the 50th Fibonacci number, one team of humans doing the math versus a team students writing a program to stress the importance of computing for calculations. "><a class="a2a_button_facebook"><span class="a2a_label">Share Have students compete calculating to the 50th Fibonacci number, one team of humans doing the math versus a team students writing a program to stress the importance of computing for calculations. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Have students compete calculating to the 50th Fibonacci number, one team of humans doing the math versus a team students writing a program to stress the importance of computing for calculations. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>Have groups of 2-3 students work together to try calculate the 50th Fibonacci number using pencil and paper.</li> <li>Have another group (or groups) of students write code that will calculate the same Fibonacci number.</li> <li>Pick a number high Fibonacci number, like the 50th, so that the computer calculation takes a minute or two, giving the humans have a chance to do the calculation and beat the computer.</li> <ul><li>An instantaneous answer that only takes the computer a few seconds to calculate doesn’t pose students with a challenge.</li> </ul></ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Sun, 01 Feb 2015 00:07:29 +0000 cstt 412 at https://www.csteachingtips.org Use Shapes, Rectangles, and Squares to teach objects and inheritance in Java, tell students they’re the only ones who can complete the job for extra engagement. https://www.csteachingtips.org/tip/use-shapes-rectangles-and-squares-teach-objects-and-inheritance-java-tell-students-theyre-only <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Use Shapes, Rectangles, and Squares to teach objects and inheritance in Java, tell students they’re the only ones who can complete the job for extra engagement. </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-01-31T16:05:20-08:00" title="Saturday, January 31, 2015 - 16:05" class="datetime">Sat, 01/31/2015 - 16:05</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/use-shapes-rectangles-and-squares-teach-objects-and-inheritance-java-tell-students-theyre-only" data-a2a-title="Use Shapes, Rectangles, and Squares to teach objects and inheritance in Java, tell students they’re the only ones who can complete the job for extra engagement. "><a class="a2a_button_facebook"><span class="a2a_label">Share Use Shapes, Rectangles, and Squares to teach objects and inheritance in Java, tell students they’re the only ones who can complete the job for extra engagement. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Use Shapes, Rectangles, and Squares to teach objects and inheritance in Java, tell students they’re the only ones who can complete the job for extra engagement. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>Begin by providing a GUI (Graphical User Interface) that draws shapes on the screen.</li> <ul><li>Students will want to create a GUI, you’ll need to explain that they need to learn the basics first before delving into creating their own GUIs.</li> </ul><li>Have students draw a shape (rectangle, oval, etc.) on the screen using the built-in shape classes.</li> <ul><li>You’ll need to give them a quick lesson on how to use the methods of the Graphics class.</li> </ul><li>Next, provide a problem that the built-in shape classes do not solve (area, perimeter, etc.)</li> <ul><li>This creates a situation where students will have to build their own shape class to solve the given problem .</li> </ul><li>Tell students the built in program doesn’t have area (e.g. a getArea() method) so they’ll have to write their own.</li> <li>Check out <a href="https://drive.google.com/folderview?id=0B0w0E8XhbH4ULVp5WENSVU1wRXc&amp;usp=sharing">the files used for this assignment</a>, including the GUI students were provided with (contained in file MyDrawings.java).</li> </ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Sun, 01 Feb 2015 00:05:20 +0000 cstt 411 at https://www.csteachingtips.org Use graphics when possible to keep students engaged because text-only output can discourage students. https://www.csteachingtips.org/tip/use-graphics-when-possible-keep-students-engaged-because-text-only-output-can-discourage <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Use graphics when possible to keep students engaged because text-only output can discourage students.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-01-31T16:02:12-08:00" title="Saturday, January 31, 2015 - 16:02" class="datetime">Sat, 01/31/2015 - 16:02</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/use-graphics-when-possible-keep-students-engaged-because-text-only-output-can-discourage" data-a2a-title="Use graphics when possible to keep students engaged because text-only output can discourage students."><a class="a2a_button_facebook"><span class="a2a_label">Share Use graphics when possible to keep students engaged because text-only output can discourage students. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Use graphics when possible to keep students engaged because text-only output can discourage students. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>In teaching an optional, after-school class for high school students, Rodriguez had 66% attrition when using text-only output.</li> <ul><li>"We believe we would have been able to keep more of the students engaged if we had used more visual output."</li> </ul><li>Later we wrote graphics output for their program. Students didn’t need to understand how the graphics code worked, but were able to add logic and functionality that used our graphics code.</li> <li>Check out <a href="https://drive.google.com/file/d/0B0w0E8XhbH4UQWZ6SXJ3YkRIRU0/view?usp=sharing">this slideshow that introduces students to Graphical User Interfaces (GUI) in Java</a>.</li> <ul><li>The specifics of how a GUI is built are too advanced for beginning students.</li> <li>This presentation shows them the basics without getting into too much detail.</li> </ul></ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Sun, 01 Feb 2015 00:02:12 +0000 cstt 410 at https://www.csteachingtips.org Give students a large data file to sort when teaching sorting algorithms to remind students that computers are great at dealing with a large set of data. https://www.csteachingtips.org/tip/give-students-large-data-file-sort-when-teaching-sorting-algorithms-remind-students-computers <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Give students a large data file to sort when teaching sorting algorithms to remind students that computers are great at dealing with a large set of data.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-01-31T15:37:44-08:00" title="Saturday, January 31, 2015 - 15:37" class="datetime">Sat, 01/31/2015 - 15:37</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/give-students-large-data-file-sort-when-teaching-sorting-algorithms-remind-students-computers" data-a2a-title="Give students a large data file to sort when teaching sorting algorithms to remind students that computers are great at dealing with a large set of data."><a class="a2a_button_facebook"><span class="a2a_label">Share Give students a large data file to sort when teaching sorting algorithms to remind students that computers are great at dealing with a large set of data. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Give students a large data file to sort when teaching sorting algorithms to remind students that computers are great at dealing with a large set of data. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>Provide students with a file that is missing lines for students to fill in in the implementation of the sorting algorithm.</li> <ul><li>The program should execute when you give it to the students, but give an incorrect output.</li> <li>For this first step, students should be working with a small set of data.</li> </ul><li>After students have a working solution with the small set of data, give them a large set of numbers (maybe 10,000) to sort through.</li> <ul><li>Tell them their solution must be identical to yours to be correct.</li> <li>Use a web resource to get thousands of random numbers. (e.g. <a href="http://www.random.org/integers/">www.random.org/integers/</a>)</li> <ul><li>This helped avoid having students hard code the solution.</li> </ul></ul><li>Below we have solution code for implementing sorting algorithms. Remove some of the implementation and then provide this code to your students.</li> <ul><li>Download <a href="https://drive.google.com/file/d/0B-m4lOa0X41jV3hBcHZrRThqaXM/view?usp=sharing">the file DemonSort.java here</a>.</li> <li>Note: File is called "DemonSort" because the school mascot was the Demons.</li> </ul><li>The sorting algorithms used in this assignment are:</li> <ul><li>insertionSort, selectionSort</li> </ul></ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Sat, 31 Jan 2015 23:37:44 +0000 cstt 409 at https://www.csteachingtips.org Misconception: Students have difficulty using the correct data types in Java because their go-to data type is int most of the time. https://www.csteachingtips.org/tip/misconception-students-have-difficulty-using-correct-data-types-java-because-their-go-data-type <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Misconception: Students have difficulty using the correct data types in Java because their go-to data type is int most of the time.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-01-31T15:34:23-08:00" title="Saturday, January 31, 2015 - 15:34" class="datetime">Sat, 01/31/2015 - 15:34</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/misconception-students-have-difficulty-using-correct-data-types-java-because-their-go-data-type" data-a2a-title="Misconception: Students have difficulty using the correct data types in Java because their go-to data type is int most of the time."><a class="a2a_button_facebook"><span class="a2a_label">Share Misconception: Students have difficulty using the correct data types in Java because their go-to data type is int most of the time. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Misconception: Students have difficulty using the correct data types in Java because their go-to data type is int most of the time. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>Students consistently get compilation errors for declaring a variable as an int that should actually be holding an object.</li> <ul><li>int x = "cat";</li> </ul><li>It seems like this happens because students aren’t paying enough attention to the type of the variables.</li> <li>This misconception was experienced in an objects-later AP CS course and might be less likely with an objects-first curriculum approach.</li> </ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Sat, 31 Jan 2015 23:34:23 +0000 cstt 408 at https://www.csteachingtips.org