Mr. Meinzen - AP Computer Science - Principles

"Success is the ability to go from one failure to another with no loss of enthusiasm." Winston Churchill

P6: Project 6 - Computing Innovation : Presentation and Evaluation of Learning

including Legal & Ethical Considerations

 

Learning Objectives :

  • LOs : 3.1.1 [P4], 3.1.2 [P6], 3.1.3 [P5], 7.1.1 [P4], 7.1.2 [P4], 7.2.1 [P1], 7.3.1 [P4], 7.4.1 [P1], 7.5.1 [P1], 7.5.2 [P5]

Computational Thinking Practices :

  • P1, P4, P5, and P6 - Connecting Computing, Analyzing Problems & Artifacts, Communicating, and Collaborating.

Rubrics

Rubric for Teams

Scoring Rubric :

Team Student Names ____________________________________________

Score

Points Possible

Scored By:

Computing Innovation : _____________________________

Include a separate typed identification of:

  1. 2 or more Learning Objectives -- see Learning Objectives & Essential Knowledge Statements (LO's & EK's)
  2. 5 or more Essential Knowledge statements, and
  3. Citation of sources (3 minimum)...be ready to justify why your sources were reliable
 

10

Teacher

Quality of pre-Quiz and post-Quiz design [including 5 Essential Knowledge points addressed clearly]
[-5pts for more than 1 page each]

 

10

Teacher

Technical Content of Presentation [see course schedule]
[-5 pts for each day that team was not prepared to present]

[-5 pts for not explaining what Data is used and transformed]

[-5 pts for not explaining what is the Input]

[-5 pts for not explaining what is the Bias.]

[-5 pts for not including Effects that are Harmful and Beneficial]

[-5 pts for not including Improvements through Collaboration]

[-5 pts for not including Impacts beyond intended Purpose]

[-5 pts for not identifying the Essential Knowledge statements

[-5 pts for not incorporating a discussion and/or Question/Answer session...including being able to justify reliable sources of information

50

Peer Group

"Effectiveness" & "success" of teaching as based on another team's score improvements.

 

20

Presenter (student)

Team's Self-Analysis of teaching experience

1.Write a few CONCISE sentences in a list that summarize constructive criticism of your team's project.

 

 

10

Teacher

Identification of Individual Team's Contributions [evidence that each individual contributed and understood 5 EK's addressed as well as topic]

 

10

Teacher

Project Total

100

Rubric for Individuals

Scoring Rubric :

Name of Presenter___________________________

Score

Points Possible

Scored By:

Computing Innovation : _____________________________

Include a separate typed identification of:

  1. 2 or more Learning Objectives -- see Learning Objectives & Essential Knowledge Statements (LO's & EK's)
  2. 5 or more Essential Knowledge statements, and
  3. Citation of sources (3 minimum)...be ready to justify why your sources were reliable
 

10

Teacher

Technical Content of Presentation [see course schedule]
[-5 pts for each day that team was not prepared to present]

[-5 pts for not explaining what Data is used and transformed]

[-5 pts for not explaining what is the Input]

[-5 pts for not explaining what is the Bias.]

[-5 pts for not including Effects that are Harmful and Beneficial]

[-5 pts for not including Improvements through Collaboration]

[-5 pts for not including Impacts beyond intended Purpose]

[-5 pts for not identifying the Essential Knowledge statements

[-5 pts for not incorporating a discussion and/or Question/Answer session...including being able to justify reliable sources of information

50

Peer Group

Quality of pre-Quiz and post-Quiz design [including 5 Essential Knowledge points addressed clearly]
[-5pts for more than 1 page]

 

10

Teacher

"Effectiveness" & "success" of teaching as based on student score improvements

 

20

Presenter (student)

Self-Analysis of teaching experience

1. Write one or two CONCISE sentences that summarize constructive criticism of your project.

 

 

10

Teacher

Engineering Notebook - update of ToC, project header, important formulas/code, calculations, collaborators, notes, marking of Essential Knowledge statements, etc.

 

10

Teacher

Project Total

100

Instructions

You are to create a Lesson Plan to teach to your peers about a Computing Innovation and its impact. The teaching will be done using the following specifications.

  1. You will need to identify & select ONE Computing Innovation topic to investigate with regard to its impact on society, economy, or culture. Consideration of Beneficial and Harmful issues must be part of your investigation.

  2. You will identify corresponding Learning Objectives to address from Big Ideas.

    1. See this link for a complete organized list of Big Ideas and Learning Objectives.
    2. Official APCS-Principles curriculum framework is here.
  3. You need to create and administer a maximum of 1/2 page pre-assessment quiz that each of the other students (peers) will take to determine their base level of understanding of your topic. Note: aligning questions to the Essential Knowledge statements may be helpful.

  4. You are to create and present your topic (using your Lesson Plan) that will explain your Computational Innovation to the other students. Including Essential Knowledge points along with several other requirements specifed in the scoring rubric as a required part of your presentation.

  5. You will create and administer a maximum of 1/2 page post-assessment quiz that each of the students will take to determine how much their understanding of your Computational Innovation increased due to your teaching. You should use the same page for both the pre-Quiz and post-Quiz. Note: Aligning your post-quiz to your pre-quiz is an effective pattern to identify peer-learning.

  6. You will complete a self-assessment to measure and identify strengths and weaknesses of your teaching experience and calculate the "effectiveness" of your peers' learning of your topic.

Specifics

  • You may choose any computing innovation topic based on:

    • an advanced technology based on an article from IEEE Spectrum magazine (see Mr. Meinzen), or
    • any technical topic that is pre-approved by Mr. Meinzen (i.e. get his initials on the scoring rubric).
  • The single-page "pre-Quiz" and "post-Quiz" must be turned into Mr. Meinzen a minimum of two days prior to the pre-Quiz being administered.

  • You must administer and score the "pre-Quiz" for all students before your give the presentation. Printout the Scoring Table sheet.

  • The presentation should be less than 5 minutes (including Q&A) in length.

  • The presentation should address at least:

    • 5 Essential Knowledge points.

    • What Data is used and transformed

    • What is the Input

    • What is the Bias.

    • At least one Effect that is Harmful and one Effect that is Beneficial]

    • At least one Improvement through Collaboration

    • At least one Impact beyond intended Purpose

    • Include graphics, sounds, transition effects and any other special effects that are USEFUL.

    • PowerPoint slide is acceptable but preference will be given to other types of presentations...actual Explore Task cannot be submitted as .ppt (ie. PowerPoint)

    A question and answer session MUST follow your presentation.

  • Your post-Quiz must be administered to all students after your presentation You must score and turned in the results of your post-Quiz using the same Scoring Table that you completed for the pre-Quiz.

  • You must complete the Scoring sheet by answering the questions found at the bottom of the Scoring Table sheet.

Sample Project 6 : Presentation & Evaluations of Learning : Blockchain, Cryptocurrency, and Bitcoin (2018)

  1. Pre-Quiz : Cryptography, Blockchain, and CryptoCurrency (BitCoin)

    1. On a piece of paper, write your name, the instructor's name (so quizzes are returned), and topic
    2. Answer the following questions as best you can (remember, this is a pre-quiz...it assesses your knowledge BEFORE being taught)
      1. Fill in the blank : "Cryptography is the ________ and _______ communication in the presence of an ____________."
      2. Fill in the blank : A "hash", "hashCode", and "digest" converts ______ into a fixed-sized ________
      3. Fill in the blank : A "coin" that is "mined" is simply a NONCE or a "number that is used ______."
      4. Fill in the blank : A block used in a block-chain is made up of 2 parts : metaData + ______
      5. Fill in the blank : The metaData in a block usually contains 4 parts : timeStamp + hash of block data + hash of previous block header + _______
      6. Fill in the blank : One critical feature of a block chain is that any change to a previous block will automatically change _______.
      7. What possible harm could cryptoCurrency (i.e. BitCoin) represent in society, culture, or the economy?
      8. What possible benefit could cryptoCurrency (i.e. BitCoin) represent in society, culture, or the economy?
      9. What legal or ethical concern might be raised by blockChains?
  2. Presentations

    • Presentation : Resources & References :

    • Presentation : Primitives : Technology to be Understood

      1. Cryptography : secure and reliable communication in the presence of an adversary

      2. public int hashCode(Object data) : a function or method (aka a "hash" or "digest") Takes any amout of data (i.e. any Object, file, image, financial transaction,legal contract, sensor data, etc.) and mathematically converts it into a single, fixed-sized number (Example: the SHA256 function always generates 256 bits or 64 hexadecimal values). Properties of a good hashCode are:

        • collision-resistant : 2 different data or objects will create 2 different hash values (or just :"hashes") : adversary cannot create a duplicate hash from fake data

        • one-way (or preImage resistant) : adversary cannot re-create the original Object data from the hash

        • second preImage resistant : adversary cannot easily guess an input Object data that will create a specific hash

          • ...though a part of the data Object may be chosen/calculated (i.e. "mined") to create a "partial guess" (see Nonce below where the Nonce is a number that is "chosen" in order to create a short sequence of 0's in the resulting hash).

        • Note: the terms "hash", "hashCode" "digest", "hash value" and "hashing" are synonymous...all refer to a fixed-length number created by converting any digital data into the fixed-length number using a mathematical function.

        • Example : We can write the following hashCode() method to convert a name into a 2-digit number
          Caution: why is this a "bad" hashCode() function?
          public int hashCode(String name)
          {
              int total = 0;
              for (int i=0 ; i<name.length(); i++)
              {
                 char character = name.charAt(i); //convert each letter to a character
                 int value = (int) character;     //convert the character to a number    
                 total = total + value;           //add the value to the total for the name
              }
              return total % 100;  // return only last 2 digits of total
          }
                                                         
      3. public-private key cryptography (i.e. asymmetric keys) : two numbers that are related uniquely mathematically (i.e. 15-3*5 by First Fundamental Theorem of Arithmetic aka Prime-Factor Theorem)

        1. public key = a number that is used to encode/encrypt some information to be sent publically to the owner of the public-private key

        2. private key = a number that is used to decode an encoded (encrypted) messaged by the owner. The private key must be kept secret by the owner. Private keys may be stored in a digital "wallet"

        3. address = hashCode(public key); // allows for anonymous accounts using blockchain

        4. digital signature : cryptographic technique to verify that a message wasx signed with a private key (using the public key), non-repudiation (user cannot deny sending message), and integrity (message was not altered during transmission).

        5. Example (simplistic) : private key=3; public key=15...the number 15 can be used to encode/encrypt a message but only the person who has the private key=3 can decrypt the message as 5*3=15. Unfortunately, private key=3 is "easy" to guess. Real keys use thousands of digits that are virtually impossible to guess.

    • Presentation : Block = block data + block header

      1. block data = any-sized digital information that is to be stored. This could be a ledger=list of financial transactions (i.e. money), file(s), image(s), emails, etc.

      2. block header (i.e. metaData) = Timestamp + hashCode(block data) + hashCode(previous block header) + Nonce

        1. The Timestamp requires computers/servers to be coordinated using standardized timing conventions. Note: a hash of the previous block header creates a "link" that connects other blocks that are sequenced in time.

        2. Nonce = a Number that is used only once.

          1. The Nonce is what is "mined" because it is difficult to find or calculate (i.e. it is a solution to a mathematical puzzle)

          2. "Mathematical Puzzle" = the Nonce--when combined with the other parts of the block header--must generate a hash value that must start with a sequence of zero's (when using the SHA256 hashCode, it is usually the first six 0's out of the 64 hexadecimal values in the hash value).

          3. When a Nonce is discovered/found/"mined", the block=hashCode(data+hashCode(prior block header) + Nonce) is called a "signed" block or "signed" digest

    • Presentation : Block Chain (sequenced in time) = first block => 2nd block => 3rd block => etc.


      (diagram courtesy of NIST)

    • Presentation : Features of every Blockchain:

      1. Distributed : no need to have a trusted third party provide the "right answer" or "verify" the data—every user within the system can verify the system’s integrity and re-create the blockchain.

      2. Adversary-resistant : to "hack" the system, a bad-actor must either: 1) alter an existing chain by re-creating an alternate and newer (longer) chain faster than all other good-actors are building on the current "good" (i.e. longest) chain or 2) take over 51% of the nodes that are agreeing on the "good" chain (think government-sized bad-actors).

        Neither approach, generally, is "better" than just participating as a "good actor".

      3. Consensus : to add a new block to the blockchain, all nodes must come to a common agreement over time; however, some temporary disagreement is permitted...but eventually must be resolved/decide. Usually the "longest chain" is accepted as it has the most invested (i.e. more Nonces have been mined) in the chain. This is called "Proof of Work" as mining Nonces is computationally intensive (think electricity + computers).

      4. Immutable (technically "tamper evident & tamper resistent") : once a block as "accepted" as being part of the chain, any tampering (changing of a previous block) can be detected by simply checking the hashCode of a questionable block. For this reason, most nodes (computers) wait for several blocks to be added before "accepting" an older block to be valid.

      5. Slow solution + quick check : The puzzle is designed such that solving the puzzle is difficult but it is easy to check that a solution is valid. This enables all other full nodes (computers in the blockchain network) to easily validate any proposed next blocks, and any proposed block that did not satisfy the puzzle would be rejected quickly.

      6. Weaknesses :

        1. Depends on security of hashCode() function (i.e. SHA256) not having a flaw or backdoor;

        2. keys (especially private key) not being discovered...but this effects only the owner of the key and their data;

        3. Just one cryptographic system being "broken" may compromise just part of the blockchain/ledger (ex: financial transactions) (i.e. by quantum computers or a flaw in programming)

        4. One large bad-actor (>50%) may take control of blockchain; early in the blockchain's existence it is easier to compromise; and when few nodes/participants are using blockchain.

        5. "Oracle Problem" : connection between real-world transactions/measurements and the digital blockchain may not be reliable and not decentralized (i.e. susceptible to single-point failures)

        6. Inefficient : As a specific blockchain gets older, the cost of "mining" goes up in terms of computing and electricity costs. Every new accepted block requires every miner to start looking for new coins (i.e. new Nonces).

      7. Example from Bitcoin (credit to NIST pages 19-22))

        Bitcoin uses the proof of work model, adjusts the puzzle difficulty every 2016 blocks to influence the block publication rate to be around once every ten minutes. The adjustment is made to the difficulty level of the puzzle, and essentially either increases or decreases the number of leading zeros required. By increasing the number of leading zeros, it increases the difficulty of the puzzle, because any solution must be less than the difficulty level – meaning there are fewer possible solutions. By decreasing the number of leading zeros, it decreases the difficulty level, because there are more possible solutions. This adjustment is to maintain the computational difficulty of the puzzle, and therefore maintain the core security mechanism of the Bitcoin network. Available computing power increases over time, as does the number of publishing nodes, so the puzzle difficulty is generally increasing

  3. Post-Quiz : Cryptography, Blockchain, and CryptoCurrency (BitCoin)

    1. On a piece of paper, write your name, the instructor's name (so quizzes are returned), and topic
    2. Answer the following questions as best you can:
      1. Fill in the blank : "Cryptography is the ________ and _______ communication in the presence of an ____________."
      2. Fill in the blank : A "hash", "hashCode", and "digest" converts ______ into a fixed-sized ________
      3. Fill in the blank : A "coin" that is "mined" is simply a NONCE or a "number that is used ______."
      4. Fill in the blank : A block used in a block-chain is made up of 2 parts : metaData + ______
      5. Fill in the blank : The metaData in a block usually contains 4 parts : timeStamp + hash of block data + hash of previous block header + _______
      6. Fill in the blank : One critical feature of a block chain is that any change to a previous block will automatically change _______.
      7. What possible harm could cryptoCurrency (i.e. BitCoin) represent in society, culture, or the economy?
      8. What possible benefit could cryptoCurrency (i.e. BitCoin) represent in society, culture, or the economy?
      9. What legal or ethical concern might be raised by blockChains?
  4. Self Analysis : Improvement of Scores

    Name of Student

    Pre-Quiz Score

    Post-Quiz Score

    Percent Improvement [i.e. (postQuiz score - pre-Quize Score)/(preQuiz Score)]

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Average of all Percent Improvement Scores

     

 

Other ideas to research

To Turn In [5 to 6 pages in the following order]

  • 1-page: Scoring Rubric (this page)

  • 1-page: pre-Quiz and post-Quiz (with answers for Mr. Meinzen)

  • 1-page: printout of your Lesson Plan(i.e. presentation) before giving the presentation.

  • 1-page: scoring improvement calculations (difference of pre-Quiz and post-Quiz for each student and average of all students who took your quizzes).

  • 1 or 2 page: Analysis :

    • Topic, Learning Objectives, & Essential Knowledge points addressed.
    • Properly identified sources of information similar to a a Works-cited page...be sure to include the IEEE citation if the magazine is used. Note: These should be used as in-line references in your Written Response (i.e. presentation).
    • Short & concise Constructive Critique of your project. You may include:
      • any discrepencies between expected student scoring improvements and actual improvements,
      • what you could have done to improve your presentation (i.e. teaching methodology),
      • what you could have done to increase your score on the Explore Task Rubric
  •  

P7: Project 7 - Three Languages Project & Rubric

 

Learning Objectives :

  • LOs : 1.2.5 [P4], 4.1.1 [P2], 4.1.2 [P5], 4.2.1 [P1], 4.2.2 [P1], 4.2.3 [P1], 4.2.4 [P4]

Computational Thinking Practices:

  • P1, P3, P4, P5 - Connecting Computing, Abstracting, Analyzing Problems & Artifacts, and Communicating

Instructions

  • Write a computer algorithm. The algorithm should be programmed in 3 different CS languages. One must be using the AP CSP Reference Sheets for text-based and block-based code. The second should be in Java. The third must use a "real" computer language (i.e. Python, JavaScript, BASIC, C++ or other language approved by instructor).

  • The program should, using loops and conditionals, be able to:

    1. declare and initialize (read or assign) an array of 10 random integers,

    2. print this array,

    3. define and call a function/method to sort the array and,

    4. print the sorted array.

Specifications

  • Be prepared to demonstrate to the teacher your working code at a computer (for psuedoCode or flowChart, demonstration includes writing the result of the execution line-by-line or block-by-block)

  • Print out of all listing of "real" programming code and hand-written code (text-based and block-based)

  • Follow expectations for professional programming (commenting, indentation, etc.).

  • Due 1 week after assigned.

This is an example of block-based code...with thanks to https://bakerfranke.github.io/apml/

DISPLAY "Enter the size of a list:"
size ← INPUT
i ← 0
REPEAT size TIMES
  i ← i + 1
  listAi ← 2*i

REMOVE listA,1
swap listA, 1, LENGTHlistA

FOR EACH number IN listA
  DISPLAY number



PROCEDURE swap listB, index1, index2
  temp         ← listBindex1
listBindex1 ← listBindex2
listBindex2 ← temp

This is an example of text-based code... with thanks to https://bakerfranke.github.io/apml/
 
DISPLAY ( "Enter the size of a list:")
size <- INPUT()
i <- 0
REPEAT size TIMES 
{
   i        <- i + 1
   listA[i] <- 2*i
}
REMOVE (listA,1)
swap (listA, 1, LENGTH(listA))
FOR EACH number IN listA
{
   DISPLAY (number)
}


PROCEDURE swap (listB, index1, index2)
{
   temp          <- listB[index1]
   listB[index1] <- listB[index2]
   listB[index2] <- temp
}

					
This is an example of coding for robot movement
                   
      <-            
                   
                   
      X X X X      
                   
          end        
                   
                   
                   

MOVE_FORWARD()

TURN_LEFT()

REPEAT 5 TIMES

{

      MOVE_FORWARD()

}

TURN_LEFT()

REPEAT 3 TIMES

{

      MOVE_FORWARD()

}

s4>                 <s3
              X    
        X          
                   
                   
              X    
                   
                   
    X           X  
<s1                 s2>

Rules: Four Teams (s1, s2, s3, and s4). Hitting an "X" will stop your program's execution.

 

Objective: Hit each color.

 

Tie-breaker: Team with fewest lines of code wins.

 

STUDENT SOLUTIONS

 

Project 7 - Three Languages Resources : Python, C++, and Java IO on student devices

 

APCS-Principles Exam Reference Sheet(s) :

  • notation used on questions during written Exam...available to students during AP CSP Exam

  • see Appendix on the Official Course Description

Programming Languages over the Years

2021 : Python on student-issued devices:

  1. Type the following code in Textpad (or any editor) and save it as helloWorld.py in any directory you choose (ex: H:\myPythonFolder\)
    • #!python
    • import sys
    • print('hello to the world')
  2. Make sure Windows can find the python.exe file by adding a value to your account's system %PATH% variable by:
    1. Search and open environment variables which should allow you to choose "Edit environmment variables for your account"
    2. Select the "Path" variable then click on "Edit..."
    3. Select "New" and type
      • C:\Users\studentLoginName\AppData\Local\Programs\Python\Python35
      • Hint: replace studentLoginName with your username when you logged onto the computer
    4. Finally, click on "Move Up" until the new environment value is at the top of the list (or above the "C:\...\WindowsApps" value)
    5. Alternately, in Windows 10 , you use the console command to set the environment variable by (Hint: in the search bar type "cmd" or "powershell")
      • [Environment]::SetEnvironmentVariable("PATH", $Env:Path + ';C:\Users\studentLoginName\AppData\Local\Programs\Python\Python35', "user")
      • Hint: replace studentLoginName with your username when you logged onto the computer
  3. Now run your python module (or program) in Windows 10, by using the console (Hint: in the search bar type "cmd" or "powershell")
    1. Change to the directory where you saved helloWorld.py by first accessing the appropriate device drive by entering:
      • H: (or C: or G: or F: or whatever drive letter you stored you helloWorld.py file)
    2. Then change to the folder where you stored your helloWorld.py file
      • chdir myPythonFolder
    3. Verify that you are in the correct directory and can see your helloWorld.py file by entering
      • dir
    4. Once you see the helloWorld.py file, check the python interpreter, then run your file by entering
      • python --version // this should display Python 3.5.2
      • python helloWorld.py // this should run your program through the Python interpreter
    5. The console output should now display :
      • hello to the world

2021 : C++ on student-issued devices:

  1. Open the Dev-C++ application (small blue icon on your desktop) and create a new blank file to edit usng the menu File > New > Source File (or Ctrl+N)
  2. Type in the editor the following code and save it as helloWorld.cpp in any directory you choose (ex: H:\myCPPFolder\)
    • #include <iostream>
    • #include <string>
    • using namespace std;
    •  
    • int main()
    • {
    • string name = "Dr. Who";
    • int x = 5;
    • cout << "Hello " << name;
    • }
  3. Compile your C++ program by using from the menu Execute > Compile (or F9). Any syntax error messages will show up at the bottom window pane at the bottom of the Dev-C++ application window. Once your program compiles and has no syntax errors, it will create a file in the same directory called helloWorld.exe
  4. Run your C++ program by using from the menu Execute > Run (or F10). The console output should now display
    • Hello Dr. Who
    • Process exited after 0.07023 seconds with return value 0
      Press any key to continue . . .

Java code that might be helpful for console input/output

                    
import java.util.Scanner;

public class IOexample
{
   // use all static (i.e. class) variables for static methods...no objects
   private static Scanner scan;
  
   private static String line,s1,s2;  // line of text and 2 substrings
   private static char[] charArray;   // used to convert line of text to array of characters

   private static String word;
   private static int    x, index;
   private static double d;

   /**
   * the main() method calls the other 3 methods that do the work of
   * inputting data from keyboard, manipulating the line of text, and printing out results
   */
   public static void main(String argv[])
   {
      scan = new Scanner (System.in);  // scan the console for any data typed in via keyboard

      // INPUT the data into the static field variables
      inputData();

      // SELECT, SEARCH, and CONVERT the line in various ways (i.e. useful String methods)
      selectSearchConvert();

      // PRINTOUT the results of the INPUT and SELECT, SEARCH, and CONVERT methods
      printOut();   

   } // end main() method

   
   /**
   * INPUT data as a word, line, integer, and double
   * from the console (i.e. scanner or System.in)
   */
   public static void inputData()
   {
      // Read a single word (no whitespaces)
      System.out.print("Enter a WORD without spaces then press < enter > key ");
      word = scan.next();
      scan.nextLine();  // throw away the enter keyboard character

      // Read a line of text...this will read a String until the <enter> key is pressed
      System.out.print("Enter a LINE OF TEXT:");
      line = scan.nextLine();
 
     // READ an INTEGER
      System.out.print("Enter an int: ");
      x = scan.nextInt();

      // READ a DOUBLE
      System.out.print("Enter a double: ");
      d = scan.nextDouble();
   }

   /**
   * use various String methods to get part of the line (i.e. substring) or search
   * for a part of the line
   */
   public static void selectSearchConvert()
   {
	     // SELECT part of the line starting at first index (inclusive) and ending at second index (exclusive)
	     s1 = line.substring(7,10); // "hello world".substring(7,10) will return "orl"
	     s2 = line.substring(4);    // "hello world".substring(4) will return "o world"
	     
      // SEARCHING : get the first index within the line searching for a String (i.e. space)     
      index = line.indexOf(" "); // look for first space in the line or return -1 if not found
      
      // CONVERT a full String (i.e. line) to individual characters in an array
      charArray = line.toCharArray();
   }

   /**
   * printout the results of the static field variables from console input
   */
   public static void printOut()
   {
      // Print out results
      System.out.println("Printing out the results");
      System.out.println("   The WORD is: " + word);
      System.out.println("   The LINE is: " + line);
      System.out.println("   The integer is: " + x);
      System.out.println("   The double is: " + d);

      System.out.println("For the String : "+line);
      for (int i=0; i<charArray.length; i++)
      {
           System.out.println("   charArray["+i+"]"+" = "+charArray[i]);
      }
	     System.out.println(" "); // make sure we dont print the next data on the same line


	     System.out.println("   The index of the first space in the line is:  "+index);

	     System.out.println("   From index=7 (inclusive) to index=10 (exclusive) substring(7,10) gives: "+s1);
	     System.out.println("   From index=4 to end of line, substring(4) gives: "+s2);
   }  // end printOut() method

}  // end IOexample

                  

Other Language Insights

Flow Diagram Information can be found here :

PsuedoCode can be found here :

 

A list of general types of Programming Languages : http://www.cprogramming.com/langs.html

 

Comparison of Java and JavaScript as language features :

  • Java is a statically typed language; JavaScript is dynamic.

  • Java is class-based; JavaScript is prototype-based.

  • Java constructors are special functions that can only be called at object creation; JavaScript "constructors" are just standard functions.

  • Java requires all non-block statements to end with a semicolon; JavaScript inserts semicolons at the ends of certain lines.

  • Java uses block-based scoping; JavaScript uses function-based scoping.

  • Java has an implicit this scope for non-static methods, and implicit class scope; JavaScript has implicit global scope.

Here are some "strengths" of Javascript :

  • JavaScript supports closures; Java can simulate sort-of "closures" using anonymous classes. (Real closures in Java are available in Version 1.8 as of 2015.)

  • All JavaScript functions are variadic; Java functions are only variadic if explicitly marked.

  • JavaScript prototypes can be redefined at runtime, and has immediate effect for all referring objects. Java classes cannot be redefined in a way that affects any existing object instances.

  • JavaScript allows methods in an object to be redefined independently of its prototype; methods in a Java object are tied to its class, and cannot be redefined at runtime.

Scoring Rubric

Student Name:

Reference Language for

AP CSP [Text-based]

Language #2 Java

Language #3____________

Declare an array of integers

5

5

5

Initialize 10 random integers

5

5

5

Print random array & sorted array

5

5

5

Sort array using an abstraction (i.e. method, function, procedure, etc.)

10

10

10

Total

25

25

25

Analyze the correctness of Peer's Solution (one language): Name of Peer ______________________

15

Engineering Notebook - update of ToC, project header, important formulas/code, calculations, collaborators, notes, marking of Essential Knowledge statements, etc.

10

Project Total

100

P8: Project 8 - RoboCode: A real-time, 2D simulation game using programmable "robotic tanks."

 

Learning Objectives :

  • LOs : 1.2.4 [P6], 2.2.1 [P2], 2.2.2 [P3], 2.3.1 [P3], 2.3.2 [P3], 4.1.1 [P2], 4.1.2, 4.2.1 [P1], 5.1.1 [P2], 5.1.2 [P2], 5.1.3 [P6], 5.3.1 [P3], 5.5.1 [P4], 5.5.1 [P1], 7.2.1 [P1]

Computational Thinking Practices :

  • P1, P2 , P3, P4, and P6 - Connecting Computing, Creating Computational Artifacts, Abstracting, Analyzing Problems & Artifacts, and Collaborating.

Instructions :

Scoring Rubric :

Name(s) _________________________________________________________________

Date

Student Score

Maximum

Objective A - Design a robot with a method called moveTo(int x, int y) that will move your robot to a specific point in the battlefield as specified by the coordinates passed to the method.

[-5 pts if not commented clearly]

 

 

20

Objective B - Design a Robot that defeats a "Corner" robot at least 6 out of 10 rounds

[-5 pts if not commented clearly]

 

 

10

Objective B - Use your Robot to defeat a "Walls" robot during 10 rounds: (number of wins) x 5 pts

[-5 pts if not commented clearly]

   

50

Objective C- Design a team of 2 TeamRobots that defeats a "Corners" robot at least 8 out of 10 rounds

[-5 pts if not commented clearly]

   

10

Objective C - Use your same 2 TeamRobot to defeat two independant "Walls" robots with each winning round counting 5% (max 10 rounds)

[-5 pts if not commented clearly]

   

50

Objective D - Design a team of 3 TeamRobots for a tournament against other student's 3 TeamRobots.

1st Place - 10 points

2nd Place - 7 points

3rd Place - 4 points

  1. The tournament will be a Single Elimination pairing of 2 Teams.
  2. The winner of a bracket will be decided by best out of 10 rounds
 

 

10

Objective D - All non-Seniors will design a team of 5 TeamRobots that will compete against other student's team of 5 TeamRobots. The winner of this tournament will replace the score from Objective C.

 

 

10

REQUIRED: Engineering Notebook - update of ToC, project header, important formulas/code, calculations, collaborators, notes, marking of Essential Knowledge statements, etc.

10 (required)

Project Total (maximum 100 points)

100

Specifics :

  • You are expected to use and analyze one (or more) of the sample robots provided in the Robocode program.

  • Commenting that demonstrates CLEAR understanding of your code--as well as any code from other sources--is essential and required.

  • Lack of such clear & concise commenting will create a 20% penalty on the specific Objective being graded.

To Turn In :

  1. Students may be requried to turn in printouts of each objective's source code for their robot.

  2. If a student uses a technique borrowed from another person's design, the student must include:

    1. comment(s) recognizing the name of the original author.
    2. comment each LINE of code that was borrowed. Each comment must explain the purpose and/or reason for the code. In other words, you must demonstrate that you UNDERSTAND the purpose of each line in terms of the robot's behavior.

NOTE: You may need to change the RoboCode compiler settings for your robot. To do so, change the following option:

  • Open RoboCode

  • Open Robot Editor by choosing from the menu: Robot>Editor

  • In the Editor, select from the menu: Compiler>Options>Preferences

  • change the first option box labeled Compiler Binary

    • from ./jikes-1.22/bin/jikes.exe
    • to "C:\Program Files\Java\jdk1.7.0\bin\javac.exe" (include the quotes when you type or copy&paste)
  • Click OK button

  • You should now be able to compile your robots correctly. If not, see Mr. Meinzen or download the latest Robocode.jar installation program [currently 1.9.2.5]

P9: Project 9 Core Wars: Assembly-language (i.e. low-level) programming introducing Memory Management

 

Learning Objectives :

  • LOs : 1.2.4 [P6], 2.2.1 [P2], 2.2.2 [P3], 2.3.1 [P3], 2.3.2 [P3], 4.1.1 [P2], 4.1.2, 4.2.1 [P1], 5.1.1 [P2], 5.1.2 [P2], 5.1.3 [P6], 5.3.1 [P3], 5.5.1 [P4], 5.5.1[P1], 7.2.1 [P1]

Computational Thinking Practices :

  • P1, P2 , P3, P4, and P6 - Connecting Computing, Creating Computational Artifacts, Abstracting, Analyzing Problems & Artifacts, and Collaborating.

Instructions :

  • Using the Core Wars application and RedCode language, students will design, program, test, and compete warrior programs within the "core." Note: There are several variations on Core Wars application including nMars, pMars, A.R.E.S, CoreWin, etc.
  • Core Wars Guide at vyznetv.net
  • or
  • Top 10 Places for Corewar Newbies

Specifics :

  • Commenting that demonstrates CLEAR understanding of your code is essential.
  • Lack of such clear & concise commenting will create a 20% penalty on the specific Objective being scored.

To Turn In :

  1. Students will be expected to turn in printouts of each objective's source code for their warrior.
  2. If a student uses a technique borrowed from another person's design, the student must include:
    1. comment(s) recognizing the name of the original author.
    2. comment each LINE of code that was borrowed. Each comment must explain the purpose and/or reason for the code. In other words, you must demonstrate that you UNDERSTAND the purpose of each line in terms of the warrior's behavior.

Scoring Rubric :

  1. Be able to comment lines on a warrior (dwarf, 4 operations):
    • ADD #10, #-1
    • MOV 2, @-1
    • JMP -2, 0
    • DAT #33, #33
  2. Create your own warrior roughly five operations long with commenting. - Must not kill itself.
  3. Use and explain a copy operation. - Create a new warrior > 4 operations long with commenting.
  4. Use and explain a split operations. - Create a new warrior > 7 operations long with commenting.
  5. Tournament (if 4 or more students using project) OR 10 points more toward objective 4.

Name ________________________________

Date

Student Score

Maximum

Objective A - Comment lines on a warrior (dwarf, 4 operations), 5 points per line commented

 

 

20

Objective B - Create your own warrior roughly five operations long with commenting. - Must not kill itself.

   

30

Objective C - Use and explain a copy operation. - Create a new warrior > 4 operations long with commenting.

   

20

Objective D - Use and explain a split operations. - Create a new warrior > 7 operations long with commenting

   

20

Objective E - Tournament (if 4 or more students using project) OR 10 points more toward Objective 4

1st Place - 10 points

2nd Place - 7 points

3rd Place - 4 points

  1. The tournament will be a Single Elimination pairing of 2 warriors.
 

 

10

REQUIRED: Engineering Notebook - update of ToC, project header, important formulas/code, calculations, collaborators, notes, marking of Essential Knowledge statements, etc.

10 (required)

Project Total (maximum 100 points)

100

P10: Project 10 : Student Option - Select One of the Projects Below

 

Project A: Student Programming Option - create your own assignment/rubric

 

Project Ideas that have resources available at EHS

Reference Website

 

Project Ideas that require student resources

(i.e. not available at EHS)

Reference Website

JavaScript 1K Challenge - write an interactive program in less than 1000 characters

http://js1k.com/2013-spring/demos

 

Programming in Processing - using Java to create interactive graphics

https://www.processing.org/

JavaScript Earsketch - write a filter to shift the tempo of a musical piece.

http://earsketch.gatech.edu/

 

Google Sketchup - 3D modeling CAD (computer-aided drafting)

http://www.sketchup.com/

 

OR

 

Project B: Terminology List

 

Instructions

You are to categorize and define a list of technology-related terms. The main topic and categories will be determined by you using the following specifications.

  1. You need to select one of 3 possible Groups listed below and identify the Main Topic of the Group.

  2. Identify at least 3 categories and place each term under one of the categories.

  3. Define, in one sentence or less (i.e. < 10 words) 30 terms out of the 37 given in the Group.

    • You may not use other terms from the same Group as part of your definition.
    • You do not have to use a "dictionary" definition. A succinct explanation is sufficient.
    • Do NOT use pronouns such as "this", "it", "that", etc. Use of a pronoun in the definition will be an automatic loss of 1 point for each pronoun.
    • Do NOT use generic or extreme words such as "thing", "anything", "all", "none" unless the word applies precisely. For example, all binary systems have two options.

Scoring Rubric

Student Name ___________________________

Score

Points Possible

Group 1, 2, 3 (circle one) and Main Topic of Group: ___________________________

  • 10

Identify at least 3 categories and put each term in exactly one category

1) _______________________________

2) _______________________________

3) _______________________________

OTHER) _______________________________ _______________________________

 

  • 30

Definitions (2 points per term). Must be 10 words or less and may not use another term from the same Group in the definition.

 

  • 60

Deductions:

  • pronouns (1 per)
  • > 10 words (1 per)
  • generic words (1 per)
  • extreme words that do not apply (1 per)

 

Project Total

  • / 100

 

Specifics

  • Your term definitions must be typed, not hand-written.
Group 1 Group 2 Group 3

CDMA

TDMA

FDMA

OFDM

IEEE

ITU

ETSI

GSM

UMTS

3GPP

3GPP2-3G

LTE

LTE-A

SIM

IMEI

IMSI

MEID

ESN

MSISDN

WLAN

IEEE802.11a-n,ac

WPAN

IEEE802.15

Bluetooth

Wireless USB

ZibBee

WWAN

2G

3G

4G

EV-DO

W-CDMA

HSPA+

WiMax

VoIP

VoLTE

IEEE802.16e-m

LAN

ISP

WAN

IP

IPv4

IPv6

Router

Gateway

NAT

DHCP

TCP

HostName

Domain Name

DNS

Ethernet

Network Interface/Adaptor

MAC Address

Port

UDP

ICMP

Ping

Packet

Firewall

HTTP

HTTPS

URL

localhost

192.168.1.1

NetMask

OC3

POTS

Protocol

SSH

TLS/SSL

FTP

VPN

OSI

 

 

bit

byte

hertz

giga-

mega-

tera-

boot

bus

ASCII

clock

compiler

CPU

daisy-chaining

database

OS

datum

digitize

fragmentation

crash

partition

native mode

PCI

RISK

ROM

SCSI

64 bit addressing

virtual memory

I/O

BIOS

API

cache

CMOS

CRC

FAT

GUI

Linux

MPEG

 

AP Exam Prep and Final Exam Project

Official Fast-Facts and Resources

  • The AP Computer Science Principles Exam is 2 hours long in early May and composed of two types of multiple-choice questions:

    • Single-select multiple-choice questions: Students select one answer from among four options.
    • Multiple-select multiple-choice questions: Students select two answers from among four options.
  • APClassroom has numerous practice problems that can be assigned by your teacher.

  • There are sample questions on the Official Course Design and Exam Description

    • The Exam Reference Sheet (actually 7 pages) will be available during the Exam
  • College Board has this official webpage for student preparation for the AP CSP Exam

Debrief of Mock Exam - Special Topics

Network Design & Topology

  • Network Design : bandwidth, fault-tolerance, redundancy, scalable
  • Protocols : open versus closed, routing, addressing, packet & data stream
  • Internet : IP, TCP, UDP, HTTP/HTTPS, WWW

Cryptography & Authentication

Algorithmic Complexity

Social Issues of Internet-bases Services

  • Digital Divide
  • Privacy Issues : data aggregation
  • Bias : systematically favoring one option : intentional & unintentional
  • Crowdsourcing & Citizen Science : Indiegogo & SETI@home

 

 

Archived : No longer used:

Logic Gates & Moore's Law

  • Logic Gates - EK2.2.3F, EU5.5 :"hardware abstractions : transistors, logic gates, chips, memory, motherboards, special purpose cards, and storage devices"
  1. transistor : on/off switch used for memory and bit-wise boolean conditions
  2. Logic gates : boolean decisions using several inputs and one output. The conditions simulate a NOT, AND, & OR...also XOR, NAND.
  3. Chips : (aka Integrated Circuits) combination of logic gates & memory for a specific function (i.e. central processing unit, RAM, graphics , etc.).
  4. MotherBoard : collection of chips to solve a general-purpose such as a personal computer (PC).
  5. Special Purpose Cards : similar to motherboard except the "general-purpose" is more specialized such as Graphic Cards, Network Cards, Disk Array Cards (storage devices), etc.

 

  • Moore's Law - EK7.2.1F : "Moore's law is the observation that the number of transistors in a dense integrated circuit doubles about every two years "

 

  • Students will also prepare for a 2-hour "Mock Exam" in late April. This will be an in-school field trip.

  • Scoring Rubric :

    Student Name ___________________________ [all students must complete]

    Score

    Points Possible

    Due: 15April

    Online DRAFT submissions for both Performance Tasks - verified by the teacher as listed on Progress Report on College Board website

    1. CREATE - Individual Video (IV)
    2. CREATE - Written Response (WR)
    3. CREATE - Program Code (PC)
    • 2
    • 2
    • 2
    • 2
    • 2

    Due: 25April

    Online FINAL submissions for both Performance Tasks - verified by the teacher as listed on Progress Report on College Board website

    1. CREATE - Individual Video (IV)
    2. CREATE - Written Response (WR)
    3. CREATE - Program Code (PC)
    • 2
    • 2
    • 2
    • 2
    • 2

    For students who are NOT signed up to take the AP CSP Written Exam:

    In an MS Word document type 5 multiple-choice questions and submit electronically (email) to the teacher.

    Specifics should be in the following order:

    1. Save your file as "APCSP-Questions-MC-yourLastName.doc" and use font size 10, Times-New-Roman;
    2. Specify the Learning Objective (LO) above each question that is addressed by the question;
    3. Include 5 optional answers--in one row if possible--labeled with capital letters like: A)... B)... C)... D)... E)...
    4. [see example below]
    5. Use terminology and descriptions as close to the LO and EK's as possible;
    6. Include one or more questions that have multiple correct answers (specify in the question if there are multiple correct answers);
    7. Provide the correct answer or answers.

     

    • 5
    • 5
    • 5
    • 5
    • 5

    Project Total

    • / 25
  • Example Questions:
  • Explain characteristics of the Internet and the systems built on it.
  • Which of the following is/are hierarchical ?
  • A) BNS     B) IP addresses     C) colors   D) bandwidth     E) latency
  • Answer is B

 

  • Explain how binary sequences are used to represent digital data. [P5]
  • Select all of the following options that accurately explain how binary sequences are used to represent digital data:
  • A) Eight binary digits (8 bits) can be used to represent up to 256 different values.
  • B) Computers with many gigabytes of storage space can represent any floating point number.
  • C) The RGB color encoding is the only binary sequence to represent colors.
  • D) Sequences of bits can represent instructions as well as data.
  • E) The binary sequence 0110 could represent a decimal number but could also represent a character.
  • Answers are A, D, and E

Additional Projects

 

Project - Spreadsheets (numeric relationships)

 

Learning Objectives - students will:

 

Instructions

  • Create 2 spreadsheets in Excel, OpenOffice, or LibreOffice with the following critieria:

Specifications

  • 1st spreadsheet - the student should create a realistic college budget, include at least

    • 5 fixed monthly expenses and

    • 6 variable monthly expenses

    • The information should come from expected expenses to go to the college of your choice

  • 2nd spreadsheet - the student should find and understand/explain a home mortgage table (amortization table).

    • assume 30 year fixed rate of 8% for a $100,000 home.

    • However, be able to adjust any of these 3 parameters (principal, intererest rate, duration of loan) upon request by Mr. M.

  • Data disk with the spreadsheets

  • 2 printout pages, one from each spreadsheet

  • Due 1 week after assigned.

Scoring Rubric

Name _______________________________________

 
  • Score

College budget

 

---- 5 fixed expenses (-1 for each non-realistic)

 
  • / 5

---- 6 variable expenses (-1 foer each non-realistic)

 
  • / 5

---- 12 month totals

 
  • / 15

---- expense totals

 
  • / 15

Home Mortgage Table

 

---- 30 yr, 8%, $100,000 table

 
  • / 20

---- explanation / understanding of total cost of home + loan

 
  • / 20

---- adjustment of 3 parameters and explanation of result

 
  • / 20

Project Total

 
  • / 100

 

Additional Resources