Decision-making Computer Science Lesson to Prepare for UIL Computer Science Contest



Similar documents
Basic Programming and PC Skills: Basic Programming and PC Skills:

Visit us at

Texas Essential Knowledge and Skills Correlation to Video Game Design Foundations 2011 N Video Game Design

COMPUTER SCIENCE (5651) Test at a Glance

Chulalongkorn University International School of Engineering Department of Computer Engineering Computer Programming Lab.

Computer Programming I

Chapter 2: Elements of Java

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

JDK 1.5 Updates for Introduction to Java Programming with SUN ONE Studio 4

13 File Output and Input

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

JAVA.UTIL.SCANNER CLASS

50 Computer Science MI-SG-FLD050-02

Using Files as Input/Output in Java 5.0 Applications

Building Java Programs

Building Java Programs

J a v a Quiz (Unit 3, Test 0 Practice)

EMC Publishing. Ontario Curriculum Computer and Information Science Grade 11

CSE 1223: Introduction to Computer Programming in Java Chapter 7 File I/O

Reading Input From A File

Topic 11 Scanner object, conditional execution

Translating to Java. Translation. Input. Many Level Translations. read, get, input, ask, request. Requirements Design Algorithm Java Machine Language

Sample CSE8A midterm Multiple Choice (circle one)

Building Java Programs

Some programming experience in a high-level structured programming language is recommended.

Introduction to Java

Computer Programming I

MICHIGAN TEST FOR TEACHER CERTIFICATION (MTTC) TEST OBJECTIVES FIELD 050: COMPUTER SCIENCE

Chapter 2: Algorithm Discovery and Design. Invitation to Computer Science, C++ Version, Third Edition

ARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT,

Scanner. It takes input and splits it into a sequence of tokens. A token is a group of characters which form some unit.

Technology Applications Standards

java.util.scanner Here are some of the many features of Scanner objects. Some Features of java.util.scanner

Domains and Competencies

AP Computer Science Java Subset

AP Computer Science A - Syllabus Overview of AP Computer Science A Computer Facilities

Object-Oriented Programming in Java

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

COSC Introduction to Computer Science I Section A, Summer Question Out of Mark A Total 16. B-1 7 B-2 4 B-3 4 B-4 4 B Total 19

AP Computer Science Static Methods, Strings, User Input

Arrays in Java. Working with Arrays

D06 PROGRAMMING with JAVA

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Preet raj Core Java and Databases CS4PR. Time Allotted: 3 Hours. Final Exam: Total Possible Points 75

LAUREA MAGISTRALE - CURRICULUM IN INTERNATIONAL MANAGEMENT, LEGISLATION AND SOCIETY. 1st TERM (14 SEPT - 27 NOV)

Essentials of Computer Programming. Computer Science Curriculum Framework

Lewis, Loftus, and Cocking. Java Software Solutions for AP Computer Science 3rd Edition. Boston, Mass. Addison-Wesley, 2011.

File class in Java. Scanner reminder. Files 10/19/2012. File Input and Output (Savitch, Chapter 10)

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

Basics of Java Programming Input and the Scanner class

CS 106 Introduction to Computer Science I

Course Syllabus. COSC 1437 Programming Fundamentals II. Revision Date: August 21, 2013

CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals

Visual Logic Instructions and Assignments

TECHNOLOGY APPLICATIONS STANDARDS FOR ALL BEGINNING TEACHERS

Install Java Development Kit (JDK) 1.8

3 length + 23 size = 2

Moving from CS 61A Scheme to CS 61B Java

The following program is aiming to extract from a simple text file an analysis of the content such as:

Event-Driven Programming

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

CompSci 125 Lecture 08. Chapter 5: Conditional Statements Chapter 4: return Statement

A Baby Polar Bear Grows Up

Part-time Diploma in InfoComm and Digital Media (Information Systems) Certificate in Information Systems Course Schedule & Timetable

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

Iteration CHAPTER 6. Topic Summary

System.out.println("\nEnter Product Number 1-5 (0 to stop and view summary) :

CS Matters in Maryland CS Principles Course

JAVA ARRAY EXAMPLE PDF

Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459)

Java Basics: Data Types, Variables, and Loops

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

COMPUTER SCIENCE COURSE OUTLINE

Mobile App Design Project #1 Java Boot Camp: Design Model for Chutes and Ladders Board Game

The University of Alabama in Huntsville Electrical and Computer Engineering CPE Test #4 November 20, True or False (2 points each)

LOOPS CHAPTER CHAPTER GOALS

El Dorado Union High School District Educational Services

Arrays. Introduction. Chapter 7

IRA EXAMPLES. This topic has two examples showing the calculation of the future value an IRA (Individual Retirement Account).

Introduction to Java. CS 3: Computer Programming in Java

English for Success. Ages. Levels. Features

ARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT,

CSC 221: Computer Programming I. Fall 2011

TExES Texas Examinations of Educator Standards. Preparation Manual. 141 Computer Science 8 12

Software Design and Development. Stage 6 Syllabus

15-214: Principles of Software Construction 8 th March 2012

Computer Science III Advanced Placement G/T [AP Computer Science A] Syllabus

AP Computer Science File Input with Scanner

Programming Fundamentals I CS 110, Central Washington University. November 2015

In this Chapter you ll learn:

Stage 5 Information and Software Technology

CASCADING IF-ELSE. Cascading if-else Semantics. What the computer executes: What is the truth value 1? 3. Execute path 1 What is the truth value 2?

Introduction to Java Applications Pearson Education, Inc. All rights reserved.

Transcription:

Decision-making Computer Science Lesson to Prepare for UIL Computer Science Contest Lesson Plan Title: Decision-making Goal of Lesson: To provide students an opportunity to learn how to use if statements and decision-making to solve problems. Grade Level/Course: Computer Science I IV TEKS Addressed: Conditional Knowledge and Skills: 7A. Apply problem-solving strategies such as design specifications, modular top-down design, step-wise refinement, or algorithm development. 7F. Develop coding with correct and efficient use of expressions and assignment statements including the use of standard/user-defined functions, data structures, operators/proper operator precedence, and sequential/conditional/repetitive control structures. 7I. Use control structures such as conditional statements and iterated, pretest, and posttest loops. 7J. Use sequential, conditional, selection, and repetition execution control structures such as menu-driven programs that branch and allow user input. Overview of Lesson: First class period - the teacher will lead a discussion about if statements and decision-making. The teacher will explain if statements and decision-making and provide concrete definitions and examples. Next, the teacher will place students in small groups, asking them to work together to develop approaches for using if statements and decision-making as they move from station to station. Next class period students will access an online site ( www.codingbat.com ) and complete a practice if statement and decision-making problem. Next, the teacher will lead a review of if statements and decision-making. Finally, after being provided with a sample scenario, students will complete an individual assignment to demonstrate mastery of if statements and decisionmaking. Materials Needed: 1. Glossary of Computer Science Terms (attached) 2. Worksheet for group assignment (attached) 3. Access to the internet - www.codingbat.com 4. Worksheet for individual assignment (attached) 5. Access to the internet - http://csunplugged.org Procedures and Activities: During the first class period, the teacher will provide the students with a glossary of computer science terms related to decisionmaking (attached). describe and discuss the definitions and explain how decision-making works. organize students into small groups. have students work in groups at stations to complete the decision-making station activities. A worksheet should be given to each student. After working with others,

each student should use the group ideas to complete his/her own assignment (attached). have students discuss the group activities. Independent Practice: During the next class period, the teacher will help students complete the decision-making CodingBat activity as a warmup / review. review the prior class activities and discuss if statements and decision-making. provide each student with an assignment on which he/she will write lines of code. actively monitor the classroom and assist individual students with the assignment. have each student turn in a completed working program. Assessment: Evaluation of individual student assignments

Computer Science Terms If a construct that will allow conditions to be evaluated so that decisions can be made within the context of a programming solution. Function / Method a container for code statements that allows for code reuse and program organization. Parameter a value that allows information to be passed to a function / method. Variable a container that stores program values. A variables value will often change.

Computer Science - Group Project Name : Date : If Stations rotate stations every 10 minutes public class One public static boolean go( int num ) if( num > 10 ) return true; return false; OUTPUT true false What is this code trying to determine about the parameter num? //code in another class System.out.println( One.go(12) ); System.out.println( One.go(7) ); public class Two public static boolean tst( int num ) if( num % 2 == 0) return false; return true; INSTRUCTIONS Evaluatethecodeatleftandshowtheoutput. OUTPUT //code in another class System.out.println( Two.tst( 75 ) ); System.out.println( Two.tst( 50 ) ); public class Three //method what will return true if //num is greater than 100 and less than 200 //150 and 178 would return true //76 and 716 would return false public static boolean what( int num ) INSTRUCTIONS Writeoutthecodeneededto completemethodwhat.

Computer Science Lab Individual Project Was it freezing or not? Lab Goal: This assignment will teach you more about if statements and decision-making. You will demonstrate mastery of decision-making. Lab Description : Given daily temperature values, write a program to determine if the provided temperature value is below freezing or not. 32 degrees is considered freezing. Output Description : Print out "Below freezing." or "Not below freezing." for each value. Sample Input: 90.0 16 34.5 19.0 25.0 101 Sample Output: Not below freezing. Below freezing. Not below freezing. Below freezing. Below freezing. Not below freezing.

The following resources were used as the basis for this Lesson Plan : 1. CodingBat www.codingbat.com an online repository of coding problems. 2. A+ Computer Science www.apluscompsci.com computer science curriculum materials 3. CS Unplugged - http://csunplugged.org/ - online repository of computer science resources

Strings and While Loops Computer Science Lesson to Prepare for UIL Computer Science Contest Lesson Plan Title: Strings and While Loops Goal of Lesson: To provide students an opportunity to learn how to use strings and while loops to solve problems. Grade Level/Course: Computer Science I IV TEKS Addressed: String Manipulation and Looping Knowledge and Skills: 7B. Manipulate data structures using string processing. 7D. Code using various data types. 7F. Develop coding with correct and efficient use of expressions and assignment statements including the use of standard/user-defined functions, data structures, operators/proper operator precedence, and sequential/conditional/repetitive control structures. 7I. Use control structures such as conditional statements and iterated, pretest, and posttest loops. 7J. Use sequential, conditional, selection, and repetition execution control structures such as menu-driven programs that branch and allow user input. Overview of Lesson: First class period - the teacher will lead a discussion about strings and while loops. The teacher will explain arrays and lists and provide concrete definitions and examples. Next, the teacher will place students in small groups, asking them to work together to develop approaches for using strings and while loops as they move from station to station. Next class period students will access an online site ( www.codingbat.com ) and complete a practice string / while loop problem. Next, the teacher will lead a review of strings and while loops. Finally, after being provided with a sample scenario, students will complete an individual assignment to demonstrate mastery of strings and while loops. Materials Needed: 1. Glossary of Computer Science Terms (attached) 2. Worksheet for group assignment (attached) 3. Access to the internet - www.codingbat.com 4. Worksheet for individual assignment (attached) 5. Access to the internet - http://csunplugged.org Procedures and Activities: During the first class period, the teacher will provide the students with a glossary of computer science terms related to strings and while loops (attached). describe and discuss the definitions and explain how strings and while loops work and how they are processed. organize students into small groups. have students work in groups at stations to complete the strings and while loops station activities. A worksheet should be given to each student. After working with others, each student should use the group ideas to complete his/her own assignment (attached).

have students discuss the group activities. Independent Practice: During the next class period, the teacher will students will complete a strings / while loop CodingBat activity as a warmup / review. review the prior class activities and discuss strings and while loops. provide each student with an assignment on which he/she will write lines of code. actively monitor the classroom and assist individual students with the assignment. have each student turn in a completed working program. Assessment: Evaluation of individual student assignments

Computer Science Terms Array a fixed size group of values all of the same type. If a construct that will allow conditions to be evaluated so that decisions can be made within the context of a programming solution. Function / Method a container for code statements that allows for code reuse and program organization. List a variable size group of values all of the same type. Loop a construct that allows for statements to be executed multiple times. Parameter a value that allows information to be passed to a function / method. String a group of characters similar to an array. Variable a container that stores program values. A variables value will often change.

Computer Science - Group Project Name : Date : Strings and While Loops Stations rotate stations every 10 minutes public class One public static void go( String wrd ) System.out.println( wrd.substring(0,3) ); System.out.println( wrd.substring(3) ); //code in another class System.out.println( One.go("piggies") + "\n"); System.out.println( One.go("uilcompsci") + "\n" ); System.out.println( One.go("upandaway") + "\n" ); OUTPUT pig gies uil compsci upa ndaway public class Two public static void go( String wrd ) int i = 0; while( i < wrd.length() ) System.out.println( wrd.substring(i, i + 1) ); i++; INSTRUCTIONS Evaluatethecodeatleftandshowtheoutput. OUTPUT //code in another class System.out.println( Two.go("buzz") + "\n"); System.out.println( Two.go("rocket") + "\n" ); public class Three //methodwowillreturnanewstringcontainsalllettersfromwrd //exceptthevowels vowelsarea,e,i,o,u //thecallwo("chicken")wouldreturnchckn //thecallwo("football")wouldreturnftbll public static String wo( String wrd ) INSTRUCTIONS Writeoutthecodeneededto completemethodwo.

Computer Science Lab Individual Project Flying V Lab Goal: This assignment will teach you more about strings and while loops. You will demonstrate mastery of strings / while loops usage. Lab Description : Given a string, print out the string in the shape of flying V as shown below. Print out the flying V shape shown below for each data set. Sample Input: dog foot it butter Sample Output: d oo ggg oo d f oo ooo tttt ooo oo f i tt i b uu ttt tttt eeeee rrrrrr tttt ttt uu b

The following resources were used as the basis for this Lesson Plan : 1. CodingBat www.codingbat.com an online repository of coding problems. 2. A+ Computer Science www.apluscompsci.com computer science curriculum materials 3. CS Unplugged - http://csunplugged.org/ - online repository of computer science resources

Scanner Computer Science Lesson to Prepare for UIL Computer Science Contest Lesson Plan Title: Using Scanner Goal of Lesson: To provide students an opportunity to learn how to use Scanner to solve problems, including String problems. Grade Level/Course: Computer Science I IV TEKS Addressed: Basic Input, String, and Looping Knowledge : 1B. Compare, contrast, and appropriately use the various input, processing, output, and primary/secondary storage devices. 2A. Demonstrate proficiency in the use of a variety of input devices such as the keyboard. 2B. Use digital keyboarding standards for the input of data. 7B. Manipulate data structures using string processing. 7D. Code using various data types. 7F. Develop coding with correct and efficient use of expressions and assignment statements including the use of standard/user-defined functions, data structures, operators/proper operator precedence, and sequential/conditional/repetitive control structures. 7I. Use control structures such as conditional statements and iterated, pretest, and posttest loops. 7J. Use sequential, conditional, selection, and repetition execution control structures such as menu-driven programs that branch and allow user input. Overview of Lesson: First class period - the teacher will lead a discussion about scanner. The teacher will explain how scanner can be used for input and String processing. The teacher will provide concrete definitions and examples. Next, the teacher will place students in small groups, asking them to work together to develop approaches for using scanner to solve problems as they move from station to station. Next class period students will access an online site ( www.codingbat.com ) and complete a practice scanner or String problem. Next, the teacher will lead a review of scanner and Strings. Finally, after being provided with a sample scenario, students will complete an individual assignment to demonstrate mastery of scanner and String processing. Materials Needed: 1. Glossary of Computer Science Terms (attached) 2. Worksheet for group assignment (attached) 3. Access to the internet - www.codingbat.com 4. Worksheet for individual assignment (attached) 5. Access to the internet - http://csunplugged.org Procedures and Activities: During the first class period, the teacher will provide the students with a glossary of computer science terms related to scanner (attached). describe and discuss the definitions and explain how scanner works and how it can be used to solve problems, including String processing.

organize students into small groups. have students work in groups at stations to complete the scanner station activities. A worksheet should be given to each student. After working with others, each student should use the group ideas to complete his/her own assignment ( attached ). have students discuss the group activities. Independent Practice: During the next class period, the teacher will students will complete a scanner or String CodingBat activity as a warmup / review. review the prior class activities and discuss scanner. provide each student with an assignment on which he/she will write lines of code. actively monitor the classroom and assist individual students with the assignment. have each student turn in a completed working program. Assessment: Evaluation of individual student assignments

Computer Science Terms Array a fixed size group of values all of the same type. If a construct that will allow conditions to be evaluated so that decisions can be made within the context of a programming solution. Function / Method a container for code statements that allows for code reuse and program organization. List a variable size group of values all of the same type. Loop a construct that allows for statements to be executed multiple times. Parameter a value that allows information to be passed to a function / method. String a group of characters that is similar to an array. Variable a container that stores program values. A variables value will often change.

Computer Science - Group Project Name : Date : Scanner and String Stations public class One public static void go( ) throws IOException Scanner in = new Scanner( System.in ); System.out.println( in.next() ); System.out.println( in.nextint() ); System.out.println( in.next() ); //code in another class System.out.println( One.go() ); INPUT Fred 7 alive OUTPUT Fred 7 alive public class Two public static void yo( String line ) Scanner chop = new Scanner( line ); while( chop.hasnext() ) System.out.println( chop.next() ); INSTRUCTIONS Evaluatethecodeatleftandshowtheoutput. OUTPUT //code in another class System.out.println( Two.yo("comp sci rocks!") + "\n"); public class Three //methodwowillreturnthesumofallevenintegersinline //thecallwo("2 3 8 11 20")wouldreturn30 //thecallwo("6 7 8 9 10")wouldreturn24 public static int dat( String line ) INSTRUCTIONS Writeoutthecodeneededto comletemethoddat. Scannermethods next() nextint() nextdouble() hasnext() hasnextint() hasnextdouble() next() nextint() nextdouble()

Computer Science Lab Individual Project Which day was hottest? Lab Goal: This assignment will teach you more about scanner while reviewing loops and if statements. You will demonstrate mastery of scanner. Lab Description : Given a group of daily temperature values, write a program to determine which day of the week was the hottest. Print out "X had the hottest temperature." for each data set. Sample Input: Mon 90.0 Tue 76 Wed 34.3 Thu 19.0 Fri 25.0 Mon 30.0 Tue 56.5 Wed 94.5 Thu 79.0 Fri 65.0 Mon 10.0 Tue -16 Wed 31.5 Thu 67.0 Fri 33 Sample Output: Mon had the hottest temperature. Wed had the hottest temperature. Thur had the hottest temperature.

The following resources were used as the basis for this Lesson Plan : 1. CodingBat www.codingbat.com an online repository of coding problems. 2. A+ Computer Science www.apluscompsci.com computer science curriculum materials 3. CS Unplugged - http://csunplugged.org/ - online repository of computer science resources

For Loops Computer Science Lesson to Prepare for UIL Computer Science Contest Lesson Plan Title: For Loops Goal of Lesson: To provide students an opportunity to learn how to use for loops to solve problems. Grade Level/Course: Computer Science I IV TEKS Addressed: Looping Knowledge and Skills: 7D. Code using various data types. 7F. Develop coding with correct and efficient use of expressions and assignment statements including the use of standard/user-defined functions, data structures, operators/proper operator precedence, and sequential/conditional/repetitive control structures. 7I. Use control structures such as conditional statements and iterated, pretest, and posttest loops. 7J. Use sequential, conditional, selection, and repetition execution control structures such as menu-driven programs that branch and allow user input. Overview of Lesson: First class period - the teacher will lead a discussion about loops and specifically for loops. The teacher will explain for loops and provide concrete definitions and looping examples. Next, the teacher will place students in small groups, asking them to work together to develop approaches for solving problems with for loops as they move from station to station. Next class period students will access an online site ( www.codingbat.com ) and complete a practice loop problem. Next, the teacher will lead a review of for loops. Finally, after being provided with a sample scenario, students will complete an individual assignment to demonstrate mastery of for loops. Materials Needed: 1. Glossary of Computer Science Terms (attached) 2. Worksheet for group assignment (attached) 3. Access to the internet - www.codingbat.com 4. Worksheet for individual assignment (attached) 5. Access to the internet - http://csunplugged.org Procedures and Activities: During the first class period, the teacher will provide the students with a glossary of computer science terms related to for loops (attached). describe and discuss the definitions and explain how for loops work and how they are used to solve problems. organize students into small groups. have students work in groups at stations to complete the for loop station activities. A worksheet should be given to each student. After working with others, each student should use the group ideas to complete his/her own assignment (attached). have students discuss the group activities.

Independent Practice: During the next class period, the teacher will students will complete a CodingBat loop activity as a warmup / review. review the prior class activities and discuss for loops. provide each student with an assignment on which he/she will write lines of code. actively monitor the classroom and assist individual students with the assignment. have each student turn in a completed working program. Assessment: Evaluation of individual student assignments

Computer Science Terms Array a fixed size group of values all of the same type. If a construct that will allow conditions to be evaluated so that decisions can be made within the context of a programming solution. Function / Method a container for code statements that allows for code reuse and program organization. List a variable size group of values all of the same type. Loop a construct that allows for statements to be executed multiple times. Parameter a value that allows information to be passed to a function / method. Variable a container that stores program values. A variables value will often change.

Name : Date : For Loops Stations public class One public static boolean go( int num ) int sum = 0; for( int i = 1; i <= num; i++) sum += i; return sum; OUTPUT 15 21 //code in another class System.out.println( One.go(5) ); System.out.println( One.go(6) ); public class Two public static int yo( int num ) int sum = 0; for( int i = 1; i <= num; i++ ) if( num % i == 0) sum += i; return sum; INSTRUCTIONS Evaluatethecodeatleftandshowtheoutput. OUTPUT //code in another class System.out.println( Two.yo(5) ); System.out.println( Two.yo(10) ); public class Three //methodisprimewillreturntrueifnumisprime //methodisprimewillreturnfalseifthenumisnotprime //aprimenumberisanynumberonlydivisibleby1anditself //5, 7, 11,and13returntrue //4, 6, 8, 10,and40returnfalse public static boolean isprime( int num ) INSTRUCTIONS Writeoutthecodeneededto completemethodisprime.

Computer Science Lab Individual Project How many freezing days? Lab Goal: This assignment will teach you more about for loops. You will demonstrate mastery of for loops. Lab Description : Given two numbers, print out all odd numbers in between. Print out all odd numbers between x and y for each data set. Sample Input: 5 12 3 15 1 20 10 27 Sample Output: 5 7 9 11 3 5 7 9 11 13 15 1 3 5 7 9 11 13 15 17 19 11 13 15 17 19 21 23 25 27

The following resources were used as the basis for this Lesson Plan : 1. CodingBat www.codingbat.com an online repository of coding problems. 2. A+ Computer Science www.apluscompsci.com computer science curriculum materials 3. CS Unplugged - http://csunplugged.org/ - online repository of computer science resources

Array / List Processing Computer Science Lesson to Prepare for UIL Computer Science Contest Lesson Plan Title: Processing Arrays / Lists of Data Goal of Lesson: To provide students an opportunity to learn how to process an array / list of data and how to use arrays and lists to solve problems. Grade Level/Course: Computer Science I IV TEKS Addressed: Arrays Knowledge and Skills: 7A. Apply problem-solving strategies such as design specifications, modular top-down design, step-wise refinement, or algorithm development. 7C. Develop sequential and iterative algorithms and codes programs in prevailing computer languages to solve practical problems modeled from school and community. 7D. Code using various data types. 7F. Develop coding with correct and efficient use of expressions and assignment statements including the use of standard/user-defined functions, data structures, operators/proper operator precedence, and sequential/conditional/repetitive control structures. 7G. Create and use libraries of generic modular code to be used for efficient programming. 7I. Use control structures such as conditional statements and iterated, pretest, and posttest loops. 7J. Use sequential, conditional, selection, and repetition execution control structures such as menu-driven programs that branch and allow user input. 7K. Identify and use structured data types of one-dimensional arrays, records, and text files. Overview of Lesson: First class period - the teacher will lead a discussion about arrays and lists. The teacher will explain how to use arrays and lists and provide concrete definitions and examples. Next, the teacher will place students in small groups, asking them to work together to develop approaches for processing arrays and lists as they move from station to station. Next class period students will access an online site ( www.codingbat.com ) and complete a practice array / list processing problem. Next, the teacher will lead a review of arrays and lists. Finally, after being provided with a sample scenario, students will complete an individual assignment to demonstrate mastery of array / list processing. Materials Needed: 1. Glossary of Computer Science Terms (attached) 2. Worksheet for group assignment (attached) 3. Access to the internet - www.codingbat.com 4. Worksheet for individual assignment (attached) 5. Access to the internet - http://csunplugged.org Procedures and Activities: During the first class period, the teacher will provide the students with a glossary of computer science terms related to arrays and lists (attached). describe and discuss the definitions and explain how arrays and lists can be used to solve problems and how they are processed.

organize students into small groups. have students work in groups at stations to complete the array / list station activities. A worksheet should be given to each student. After working with others, each student should use the group ideas to complete his/her own assignment (attached). have students discuss the group activities. Independent Practice: During the next class period, the teacher will students will complete an array / list processing CodingBat activity as a warmup / review. review the prior class activities and discuss arrays and lists. provide each student with an assignment on which he/she will write lines of code. actively monitor the classroom and assist individual students with the assignment. have each student turn in a completed working program. Assessment: Evaluation of individual student assignments

Computer Science Terms Array a fixed size group of values all of the same type. If a construct that will allow conditions to be evaluated so that decisions can be made within the context of a programming solution. Function / Method a container for code statements that allows for code reuse and program organization. List a variable size group of values all of the same type. Loop a construct that allows code statements to be executed multiple times. Parameter a value that allows information to be passed to a function / method. Variable a container that stores program values. A variables value will often change.

Computer Science - Group Project Name : Date : Array Stations rotate stations every 10 minutes public class One public static int go( int[] array ) int sum = 0; for( int i = 0; i < array.length; i++) sum = sum + array[i]; return sum; OUTPUT 12 16 //code in another class System.out.println( One.go( new int[]3,6,1,2 ) ); System.out.println( One.go( new int[]2,4,7,0,3 ) ); public class Two public static int yo( int[] array ) int sum = 0; for( int num : array ) if( num % 2 == 0) sum += num; return sum; INSTRUCTIONS Evaluatethecodeatleftandshowthe output. OUTPUT //code in another class System.out.println( Two.yo( new int[]3,4,5,6,1,10,55,33,12 ) ); System.out.println( Two.yo( new int[]1,2,22,11,17,13,3,4,5,6,1 ) ); public class Three INSTRUCTIONS WriteoutthecodeneededtocompletemethodbiggerThanX. //thecallbiggerthanx(new int[]2,14,5,11,4,11,34, 10)wouldreturn4 //thecallbiggerthanx(new int[]45,64,22,56,78,32, 30)wouldreturn5 public static int biggerthanx( int[] nums, int x ) Please work with your group to write lines of poetry based on observations of your surroundings in the classroom and the guidelines described. 1. Two lines with a couplet and a simile. 2. A line with an oxymoron.

Computer Science Lab Individual Project How many freezing days? Lab Goal: This assignment will teach you more about arrays and lists. You will demonstrate mastery of array / list processing. Lab Description : Given an array / list of daily temperature values, write a program to determine how many of the days were below freezing. 32 degrees is considered freezing. Print out "There were x days below freezing." for each data set. Sample Input: 90.0, 76.5, 34.5, 19.0, 25.0, 100 30.0, 56.5, 94.5, 79.0, 65.0, 102 10.0, -16, 31.5, 67.0-5.0, 31, 14.5, 19.0, 25.0, 10, 7.9, 23 45, 55, 61.2, 77 Sample Output: There were 2 days below freezing. There were 1 days below freezing. There were 3 days below freezing. There were 8 days below freezing. There were 0 days below freezing.

The following resources were used as the basis for this Lesson Plan : 1. CodingBat www.codingbat.com an online repository of coding problems. 2. A+ Computer Science www.apluscompsci.com computer science curriculum materials 3. CS Unplugged - http://csunplugged.org/ - online repository of computer science resources