CS471: Computer Science Pedagogy - Computer Science Unit Design

Activity Goals

The goals of this activity are:
  1. To design a unit according to the UbD framework
  2. To develop a unit of lessons that incorporate various modalities, such as kinesthetic and POGIL
  3. To synthesize multiple modalities for Universal Design for Learning

Supplemental Reading

Feel free to visit these resources for supplemental background reading material.

The Activity

Directions

Consider the activity models and answer the questions provided. First reflect on these questions on your own briefly, before discussing and comparing your thoughts with your group. Appoint one member of your group to discuss your findings with the class, and the rest of the group should help that member prepare their response. Answer each question individually from the activity, and compare with your group to prepare for our whole-class discussion. After class, think about the questions in the reflective prompt and respond to those individually in your notebook. Report out on areas of disagreement or items for which you and your group identified alternative approaches. Write down and report out questions you encountered along the way for group discussion.

Guiding Questions

  • In what ways could this lesson plan be improved to promote inclusivity and the 12 pedagogical principles?
  • Adapt your lightning talk topic into a unit plan with lessons using this template.

Unit Plan: Writing and Calling Methods in Java

Adapted from the UbD Template 2.0 (https://jaymctighe.com/downloads/UbD_Template_2.docx)        
Stage 1 – Desired Results        
ESTABLISHED GOALS Transfer      
- Students will be able to write simple methods in Java that perform specific tasks. Students will be able to independently use their learning to… write and call methods using the Java programming language, incorporating parameter passing by value and by reference.      
- Students will be able to call/invoke methods to execute their code.        
         
  Meaning      
  UNDERSTANDINGS ESSENTIAL QUESTIONS    
  Students will understand that… - How do methods help us organize and reuse code?    
  - Methods allow us to reuse and modularize code. - What are the components of a method declaration?    
  - Methods have a specific syntax and structure. - How do you call a method to execute its code?    
  - Calling a method executes the code inside it. - How does return work to send back values from methods?    
  - Methods can return values back to the calling code. - What is the difference between pass-by-value and pass-by-reference arguments?    
  - Arguments can be passed into methods to modify their behavior.      
  Acquisition      
  Students will know… Students will be skilled at…    
  - How to identify the components of a method declaration including access modifier, return type, name, parameters, and method body. - Writing simple void and value-returning methods.    
  - How to modularize code by extracting parts into reusable methods. - Calling/invoking methods correctly to run the code inside them.    
  - Whether their parameters are passed by reference or by value, and the implications of each.      
Stage 2 – Evidence and Assessment        
Evaluative Criteria Assessment Evidence      
Rubric (see below) PERFORMANCE TASK(S):      
  - Coding activities - Writing methods, Calling methods, handling returns.      
  - Writing a program that demonstrates the use of custom methods to repeat code.      
  - Writing a simple class with methods to model something like a bank account.      
  OTHER EVIDENCE:      
  - Methods quiz - short answer questions on declaring and calling methods.      
  - Rubrics for coding activities and project.      
  - Teacher observation of student coding.      
  - Worksheets on method components and calling methods.      
  - Coding activities extracting logic into methods.      
         
Stage 3 – Learning Plan        
Summary of Key Learning Events and Instruction        
- Lesson on method components and syntax. - Analyzing method examples for key features. - Writing simple methods with different return types. - Calling methods and using return values. - Passing arguments to methods to modify behavior. - Coding tasks to extract logic into reusable methods. - Writing methods to model behaviors and properties of objects. - Peer code reviews and refactoring.        
Scaffolds: - Syntax templates and method signatures. - Commented code examples modeling methods. - Pair programming and peer feedback. - Incremental coding tasks before complex projects. - Rubrics detailing expectations.        
         
         

Rubric

Criteria Excellent (3-4 points) Good (2-3 points) Needs Improvement (0-1 points)
Understanding of Parameter Passing      
By Value (10%) Demonstrates a clear understanding of passing primitive data types by value. Correctly implements the concept. Correctly implements passing by value but lacks detailed explanation or has errors. Demonstrates confusion or significant errors in passing by value.
By Reference (10%) Demonstrates a clear understanding of passing objects by reference. Correctly implements the concept. Correctly implements passing by reference but lacks detailed explanation or errors. Demonstrates confusion or significant errors in passing by reference.
Distinction Between Value and Reference (10%) Clearly distinguishes between passing by value and reference, with accurate examples and explanations. Generally understands the distinction but lacks clarity or detail. Demonstrates confusion or misunderstands the distinction between value and reference.
Method Signature and Declaration      
Void Functions (10%) Correctly declares and implements void functions with proper syntax and usage. Correctly declares void functions but has minor syntax or usage errors. Has significant errors in declaring or using void functions.
Functions with Return Values (10%) Correctly declares and implements functions with return values, including proper return type and statement. Generally correct but has minor errors in return type or return statement. Has significant errors in declaring or using functions with return values.
Parameter List (5%) Correctly declares parameters with proper data types and names, adhering to best practices. Correctly declares parameters but lacks adherence to best practices or has errors. Has significant errors in declaring parameters.
Method Calling and Invocation      
Correct Calling Syntax (10%) Correctly calls methods with proper syntax, including passing arguments that match the parameter list. Generally correct but has minor syntax errors or mismatches between arguments and parameters. Has significant errors in calling methods.
Understanding of Return Values (10%) Correctly handles and utilizes return values from methods, including proper assignment and usage. Generally correct but has minor errors in handling or using return values. Has significant errors in handling or using return values.
Error Handling (5%) Implements proper error handling for method calling, such as checking for null references. Attempts error handling but lacks completeness or correctness. Ignores or improperly handles errors in method calling.
Code Style and Documentation      
Code Style (10%) Adheres to best practices in code style, including indentation, naming conventions, and readability. Generally adheres to code style but has minor inconsistencies. Has significant issues with code style, hindering readability.
Documentation (10%) Provides comprehensive documentation, including comments and JavaDoc, explaining the purpose and functionality of methods. Provides some documentation but lacks detail or completeness. Lacks proper documentation or provides incorrect or misleading comments.

Lesson Activities

POGIL Activity

Give students a pre-written Java program that includes some functions. Have them work in small groups to analyze the program by identifying the function declarations, function calls, parameters, and return values. Students complete a guided worksheet prompting them to explain how the functions are declared, called, and used in the overall program.

CS Unplugged Activity

Have students stand in two lines facing each other. One line represents the “calling” functions and the other line represents the “called” functions. Have the calling functions call out their function name and parameters. The corresponding called function acts out executing the function body and returning a value. Swap roles and repeat.

Pair Programming Activity

Have students work in pairs on writing functions based on specifications you provide. One student can write function declarations while the other writes the function body. Then they can trade roles for the next function. Partners can discuss approaches and syntax. After writing the functions, have them switch computers and call each other’s functions in a simple test program.

Programming Task

Write a Java program that calculates statistics from a list of numbers. Your program should have the following functions:

  • getNumbers() - This void function should prompt the user to input a series of numbers and store them in an array.

  • findSum() - This function should accept the array of numbers as a parameter and return the sum of the numbers.

  • findAverage() - This function should accept the array of numbers as a parameter and return the average of the numbers.

  • findMax() - This function should accept the array of numbers as a parameter and return the maximum number.

  • printResults() - This void function should print out the sum, average, and max by calling the other functions.

In the main() method, call getNumbers() to populate the array. Then call printResults() to output the final statistics.

Sample Lesson Plan for Pair Programming Activity

Lesson Plan: Collaborative Function Writing

Objective:

To reinforce understanding of function declarations and function bodies by working collaboratively to write and call functions based on provided specifications.

Duration:

45 minutes to 1 hour

Materials:

  • Computers or laptops with programming environments installed (e.g., Python, Java, C++)
  • Sample function specifications (prepared by the teacher)
  • Test program template (prepared by the teacher)

Procedure:

Introduction (5 minutes)
  • Begin the lesson by explaining the importance of functions in programming and how they help organize code and promote reusability.
  • Briefly discuss the structure of a function, including the function declaration (header) and the function body.
  • Explain that in this lesson, students will work collaboratively in pairs to write functions based on provided specifications.
Pairing Up (5 minutes)
  • Divide the students into pairs and assign each pair a computer or laptop.
  • Encourage students to work with someone they haven’t partnered with before to foster collaboration and learning from each other.
Function Writing Activity (20 minutes)
  • Provide each pair with a set of function specifications, either on a handout or projected on a screen.
  • Instruct one student in each pair to write the function declarations based on the specifications, while the other student writes the function bodies.
  • Explain that they should discuss their approaches and syntax with each other, ensuring they have a clear understanding of the task before writing the code.
  • Encourage students to ask questions and seek clarification if needed.
  • Remind them to follow the standard naming conventions and use appropriate variable names for clarity.
Role Switch and Function Review (10 minutes)
  • After the first function is completed, instruct the students to switch roles. The student who wrote the function declaration should now write the function body, and vice versa.
  • Encourage students to discuss their approaches again and provide feedback to each other on the code they’ve written.
  • Emphasize the importance of clear communication and collaboration in the programming process.
Test Program (10 minutes)
  • Provide the students with a test program template, which includes a simple program structure with placeholders for function calls.
  • Instruct the students to switch computers with their partner and insert function calls to test the functions they wrote.
  • Remind them to pay attention to the function return values and any potential errors or bugs that may arise during testing.
  • Encourage students to discuss the output of their test program with their partner and troubleshoot any issues together.
Conclusion and Discussion (5 minutes)
  • Bring the class back together for a brief discussion on the activity.
  • Ask students to share their experiences and challenges encountered during the collaborative function writing process.
  • Highlight the benefits of working in pairs, such as sharing ideas, learning from each other, and catching errors more effectively.
  • Reinforce the importance of clear communication and teamwork in programming, as it reflects real-world collaborative coding environments.
Extension Activity (optional)
  • As an extension, you can assign additional function specifications to pairs of students as homework.
  • Encourage them to continue practicing collaborative function writing and testing independently.

Submission

I encourage you to submit your answers to the questions (and ask your own questions!) using the Class Activity Questions discussion board. You may also respond to questions or comments made by others, or ask follow-up questions there. Answer any reflective prompt questions in the Reflective Journal section of your OneNote Classroom personal section. You can find the link to the class notebook on the syllabus.