Mr. Meinzen: AP Computer Science - Principles

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

Learning Objectives - students will :

  1. Understand the Advanced Placement Computer Science Principles (AP CSP) Course & Assessments

  2. Identify the purpose and use of the Engineering Notebook.

  3. Organize Engineering Notebook and prepare for the AP CSP Course

P0: Plan for the Course - The Engineering Notebook

  • Engineering Noteboook : Where should I get it?

    • To create your ownEngineering Notebook, you must do only one of the following (Note: each approach has it's own benefits and drawbacks) :

      1. Create your own physical Engineering Notebook using a traditional pen & paper (3-ring binder or spiral notebook). You would then hand-write notes and/or use printouts then cut-n-paste paper into your notebook. Your Engineering Notebook would then need to be turned-in physically--on appropriate due dates--to your teacher for scoring.

      2. Download a copy of Mr. Meinzen's Microsoft OneNote template for your Engineering Notebook. This can be found on Schoology for the course. You would then need to convert or export your Engineering Document to a PDF file to submit your PDF electronically (via Schoology) to your teacher by the due dates. ONLY non-editable & uploaded PDF files WILL BE ACCEPTED...NO LINKS, EMAILS, or other editable documents WILL BE ACCEPTED! Note: other students MAY, accidentally or intentionally, change Mr. Meinzen's template...be aware that YOU are responsible for your own Engineering Notebook...do NOT assume Mr. Meinzen will prevent all "hacking" of the template on Schoology.

      3. Create your own virtual Engineering Notebook using Google Docs or another software of you choice. You would then need to convert or export your Engineering Document to a PDF file to submit your PDF electronically (via Schoology) to your teacher by the due dates. ONLY non-editable & uploaded PDF files WILL BE ACCEPTED...NO LINKS, EMAILS, or other editable documents WILL BE ACCEPTED!

  • Engineering Notebook : Why should I use it?

    • To keep a timely record of your progress during the full semester course as well as ideas, efforts, attempts, successes and failures for each project...the how, who, what, where, when, and why for each Project.

    • For official (i.e. permenant) record-keeping and as part of your evaluation/grade throughout semester.

    • Details to include for each Project in your Engineering Notebook:

      • Always include page heading with dates and project identification

      • Always include any collaborators names and properly cite resources...for phyiscal paper, use only the front side (save back side for possible edits at end of projects/course)

      • Include any important websites, login info, photocopies,submitted code, software/hardwar used (& version #), graphs, lists, equations used, and comments along with anything another student/teacher/manager may need to "recreate" your projects (i.e. if you get sick or retire or ...).

    • Details NOT to include in Engineering Notebook:

      • general notes from class...these should be in a regular course notebook

      • scratch paper even if for calculations...only final calculations/graphs and formulas should be included

  • Engineering Notebook : What should I include in it?

    1. Front Cover: Your name, start date, end date (leave blank), course title, teacher name.

    2. First Page: Table of Contents (just complete header...as you complete each Project during the semester, you must edit the Table of Contents)

    3. Second Page: list of websites and registration info (logins & password if needed) used throughout AP CSP course...you may have to update this information as projects are completed. At a minimum, we will be using www.meinzeit.com, myAP.collegeboard.org, ecusd7.schoology.com, and www.ecusd7.org.

    4. Third Page: Ordered list of scheduled items for the course. Include dates for official Assessments and Projects.

    5. Starting Fourth page: COPY the list of all LO-EK statements (400+ lines) in your Engineering Notebook and start identifying the LO-EK's you already know.

      • NOTE 1 : The AP CSP course and EXAM is built around 5 Big Ideas [BI] broken down into 12 Enduring Understandings [EU] which are further broken down into about 100 Learning Objectives [LO] and 340 Essential Knowledge [EK] or "fact" statements you will learn and be assessed throughout the semester.

      • NOTE 2 : Be aware that the color-coded items on "Searchable Page" are NOT the same as our course projects. The color-code times such as P2: Algorithms and Program Development are refering to the 6 Practices and skills that you will be learning to DO (i.e. actions) throughout the semester by completing all projects.

      1. The LO-EK list can be found either on Schoology under the heading of "Big Ideas...." or on Mr. Meinzen's website at this link : http://meinzeit.com/APConsult-CSP-1Day/LO-EK.htm

      2. Place a "P0" by any [EK] you already have learned or know about from other courses or just information you have learned on your own or from others. As you complete each project, you will mark off additional LO-EK statements to keep track of your progess. By the end of the semester (i.e. after P9 or P10, the last project), you should be able to mark off all 400+ items on the list.

    6. After the last LO-EK page : Prepare for the first project by by labeling the next page with the title of the project as P1 : Project 1 : Part I : Create Task I .

  • Engineering Notebook : How will I be scored?

    Scoring Rubric : Engineering Notebook

    Name _________________________________________________________________

    Student Score

    Maximum

    Front Cover: Your name, start date, end date (leave blank), course title, teacher name.

     

    5 pts

    Table of Contents: header and list including start and end page numbers for the following:

    1. Registrations Info & Critical websites
    2. Schedule/due dates
    3. Requirements for assessments
    4. LO-EK statements
    5. Course Projects

    -- see Learning Objectives & Essential Knowledge Statements (LO's & EK's)

     

    5 pts

    Registration Info (websites, login usernames & passwords):

    1. create a College Board student login (write down your username & password) for AP CSP [same account used for all your AP courses] at : https://myap.collegeboard.org/login,
    2. signup for the EHS AP CSP course by using the "join code" provided by your teacher using your College Board student login,
    3. register for the AP CSP Exam by October 15th [or March 13].
    4. access the AP Digital Portfolio via myAP.collegeboard.org to understand the assessment submission process needed in April
    5. List websites that are critical for completing AP CSP. This list will "grow" as each project is completed.
     

    5 pts

    Schedule:

    1. Titles and due dates for official AP CSP Assessments
      1. Official (or final) due date,
      2. Eexpected (or class) due date
    2. Titles and due dates (approximate) for all Course Projects
     

    5 pts

    Requirements for Official Assessments (highlight submission requirements)

    1. Create Performance Task
    2. Written AP CSP Exam
     

    10 pts

    LO-EK statements...start identifying EK's already known by you mark with a "0". Upon completion of each project, identify additional EK's by date & project number.

     

    15 pts

    Header for Project 1

     

    5 pts

    Project Total

    50 pts

P0: Plan for the Create Task - The Programming Assessment

  • [30% of overall AP Score...minimum 9 hours of class time]
  • NOTE: You are NOT writing any programs at this time, you are simply reading about the expectations of the Create Task (Setup, Goals, Scoring) that must will be done later in the semester.

Brief Overview of Create Task

  • What is the Create Task?

    • The Create Task is a program the student chooses to write (i.e. create) during the AP CSP course that fulfills certain computer science requirements in order to demonstrate their knowledge of computer science.

  • What does the Create Task require?

    • The Create Task requires students to (1) write their code during the course, (2) create a video of their code running on a computer, and, (3) identify specific features (i.e. procedure & list) of their code. zUsing their third (3) component, students will explain their the identified features of code by answering questions during the AP Exam in May.

    • The Create Task requires each student to upload the three components to the College Board as part of their AP Digital Portfolio in April. to be scored in June:

      1. Program Code (PC): This is the program the student wrote either by themself or with help from other students and/or adult or online code-generator such as ChatGPT.

      2. Video (V): This is an individual student's 1-minute (or less) video recording of the program running on a computer that shows user input, functionality (how the program works), and output to the user.

      3. Personal Project Reference (PPR): This includes specific segments of the student's program code (PC) that include evidence that the student understands required computer science topics such as:

        1. Lists (i.e. arrays),

        2. Procedures (i.e. methods with parameters) and

        3. Algorithms including:

          • Sequence (2 or more lines of code),

          • Selection (if statements), and

          • Iteration (loops).

        The PPR will be given back to the student during the final (3rd) hour of the AP Exam in May to use in answering questions regarding the students selected code (PPR).

  • Where can I find the details of the Create Task?

    • The details of the Create Task can be found in the following documents/videos:

      1. In the Course Exam Description (CED) on AP Central.

      2. In the Student Handout provided by your teacher.

      3. On the videos on AP Classroom assigned by your teacher.

        1. Video: Create Performance Task: Overview (7 min)
        2. Video: Create Performance Task: Guidelines (12 min)
        3. Video: Create Performance Task: Pacing Your Project (11 min)
        4. Video: Create Performance Task: Categories and Questions (5 min)
        5. Video: Create Performance Task: Scoring Guidelines and Sample Written Response (20min)
  • Definitions students may need

    • Definitions needed to be understood for the Create Task:

      • A computational artifact is a visualization, a graphic, a video, a program, or an audio recording that you [student] create using the computer. In creating a computational artifact, you should avoid plagiarism by acknowledging, attributing, and/or citing sources and including a with your submission.

      • AP Computer Science Principles Create Performance Task Terminology (in order of appearance in the scoring guidelines of the Course and Exam Description (CED)

      • Input: Program input is data that are sent to a computer for processing by a program. Input can come in a variety of forms, such as tactile (through touch), audible, visual, or text. An event is associated with an action and supplies input data to a program.

      • Program functionality: The behavior of a program during execution and is often described by how a user interacts with it.

      • Output: Program output is any data that are sent from a program to a device. Program output can come in a variety of forms, such as tactile, audible, visual, movement or text.

      • Purpose: The problem being solved or creative interest being pursued through the program.

      • Program Code Segment: A code segment refers to a collection of program statements that are part of a program. For text-based, the collection of program statements should be continuous and within the same procedure. For block-based, the collection of program statements should be contained in the same starter block or what is referred to as a “Hat” block.

      • List: A list is an ordered sequence of elements. The use of lists allows multiple related items to be represented using a single variable. Lists are referred to by different terms, such as arrays or arraylists, depending on the programming language. In Java, an array of sorted Cards is a list.

      • Data has been stored in this list: Input into the list can be through an initialization or through some computation on other variables or list elements.

      • Collection type: Aggregates elements in a single structure. Some examples include: databases, hash tables, dictionaries, sets, or any other type that aggregates elements in a single structure. In Java, myDeck which is an arrays of Cards is a collection.

      • List being used: Using a list means the program is creating new data from existing data or accessing multiple elements in the list. In Java, myDeck[0] = new Card(0) would be "using a list" as you are assigning the two of Clubs into the first slot of the array or List.

      • Student-developed procedure / algorithm: Program code that is student-developed has been written (individually or collaboratively) by the student who submitted the response. Calls to existing program code or libraries can be included but are not considered student-developed. Event handlers are built in abstractions in some languages and will therefore not be considered student-developed. In some block-based programming languages, event handlers begin with “when”.

      • Procedure: A procedure is a named group of programming instructions that may have parameters and return values. Procedures are referred to by different names, such as method or function, depending on the programming language. In Java, any method is a procedure.

      • Parameter: A parameter is an input variable of a procedure. In Java, local declarations in a method header are parameters. Ex: public void setName( String n)... the n is the parameter.

      • Algorithm: An algorithm is a finite set of instructions that accomplish a specific task. Every algorithm can be constructed using combinations of sequencing, selection, and iteration.

      • Sequencing: The application of each step of an algorithm in the order in which the code statements are given.

      • Selection: Selection determines which parts of an algorithm are executed based on a condition being true or false. The use of try / exception statements is a form of selection statements.

      • Iteration: Iteration is a repetitive portion of an algorithm. Iteration repeats until a given condition is met or a specified number of times. The use of recursion is a form of iteration.

      • Argument(s): The value(s) of the parameter(s) when a procedure is called.

 

Before Create Task - Setup

Information students should keep in mind.

Do NOT do your "final" Create Task too early (it is due in April). You (and your peers) will be given several samples to practice writing and scoring using a scoring rubric later. You will also develop a mini-Create task to be scored by a peer before April.

Your teacher CANNOT provide feedback or help score your real (or Final) Create Task prior to submission to the College Board.

Recommended due date is 15April but final due date is 30Apr.

Note: short, one-sentence answers are usually best.

 

During Create Task - Goals

Create Performance Task : online submission by 30April, 30% of AP CSP score has 3 Components:

  1. Component A: [PC] Program Code

    • Upload all the code written by the student and any other programmer that is written & tested Independently or Collaboratively

    • Collaboration IS allowed on the PC.

  2. Component B: [V] Video

    • Upload a video displaying the running of your program that demonstrates functionality.

    • The video must be student developed that is created Independently from anyone else (i.e. not with another student).

    • Collaboration is NOT allowed on the Video.

  3. Component C: [PPR] Personal Project Reference:

    • Upload screen-captured segments of program code [ie. from PC] that were independently written by the individual student. The captured segments of code are then pasted into specific parts of the AP Digital Portfolio during the school year.

    • The PPR provides evidence that each individual student understands required computer science topics such as Lists (i.e. arrays), Procedures (i.e. methods with parameters), and Algorithms (i.e. sequence, selection, iteration/loops).

    • The PPR will be provided to the student on paper during the AP Written Exam in May.

    • Collaboration is NOT allowed on the PPR.

    Students WILL be asked a variety of questions referring to their INDIVIDUAL PPR during the 3rd hour of the Written Exam :

    1. Component C: PPR: PROCEDURE: Capture and Paste code segments that you developed showing :

      • i. PROCEDURE
        • Define procedure's name and return type (if necessary)
        • Contains and uses one or more parameters that have an effect on functionality
        • Implements and algorithm that includes sequencing, selection, and iteration
      • ii. The second program code segment must show where your student-developed procedure is being called in your program.

      Insights

      • You can only specify ONE Procedure (method or function) even if you wrote several procedures in your program code [PC].

      • No comments or identifying information can be provided in PPR

      • College Board has a PPR Tip Sheet on their website including suggestions on : font-size, screen-captures, long or wide code segments, and rotations,

    2. Component C: PPR: LIST: Capture and Paste two program code segments that contains a list (or other collection type) being used to manage complexity.

      • i. Code segment that shows how data have been stored in the list
      • ii. The second program code segment must show the data in the same list being used, such as creating new data from the existing data or accessing multiple elements in the list, as part of fulfilling the program’s purpose.
      • Insights

        • Note that you can only select only ONE list (array) even if you used several lists in your program code [PC].

        • A list (or array) "manages complexity" by giving a single name to several similar items. Ex: a list called deck is less complex than 52 individual card variables such as twoOfClubs, threeOfClubs, etc.)

        • "stored in the list" means that at least two or more elements in the list must be assigned a value. Ex: deck[0] = twoOfClubs; deck[1] = threeOfClubs;

After Create Task - Scoring

Scoring the Create Task

Note: The final scoring guideline will be published after the 2024 Reading held in June. The prompts provided are example questions that *may* show up on the Written Exam.

Row 1: Video
 
Video: input, function, output
 
0 or 1 point
The video demonstrates the running of the program including:
  • input
  • functionality: how the program works
  • output
Consider ONLY the video when scoring this point
  •  
Do NOT award a point if the following is true:
  • The video does not show a demonstration of the program running (screenshots or storyboards are not acceptable and would not be credited)
Row 2: Program Requirements [PC]
Program Code [PC] Requirements
 
0 or 1 point
The program code [PC] includes:
  • List
  • Procedure
  • Call to the procedure
  • Selection
  • Iteration
Consider the Personalized Project Reference [PPR] (or Program Code [PC] if necessary) when scoring this point
  • If the program requirements do not appear in the PPR, consider the full program code file when scoring this point.
  • The procedure does not need to have a parameter to earn this point.
  • The code segments demonstrating selection and iteration do not need to appear in the same algorithm to earn this point.
  • The code segments demonstrating selection and iteration do not need to be contained in a procedure to earn this point
Do NOT award a point if any one or more of the following is true:
  • The list is a one-element list.
  • The use of the list is irrelevant or not used in the program.
  • The use of either the selection or the iteration is trivial (i.e., does not affect the outcome of the program)
Row 3: Written Response 1 from prompt during Written Exam based on your [PPR]
Sample Prompt during Written Exam (last 60 min):
"Identify an expected user of your program. Describe one way your program's design meets the needs of this user."
 
 
Program Function and Purpose
 
0 or 1 point
The written response:
  • identifies an expected user of the program
  • describes one way the program’s design meets the needs of the identified user.
Consider Written Response 1 and the student’s Program Code when scoring this point.
  • The response must relate the program design to the needs of the identified user
Do NOT award a point if the following is true:
  • The description of the design is implausible, inaccurate, or inconsistent with the program.
Row 4: Written Response 2(a) from prompt during Written Exam based on your [PPR]
Sample Prompt during Written Exam (last 60 min):
"Consider the first iteration statement included in the Procedure section of your PPR. Identify the number of times the body of your iteration statement will execute. Describe a condition or error that would cause your iteration statement to not terminate and cause an infinite loop. If no such condition or error exists, explain how the loop could be modified to cause an infinite loop."

 

Algorithm Development
 
0 or 1 point
The written response:
  • identifies the number of times the body of the iteration statement will execute
AND
  • describes a condition or error that would cause an infinite loop
  • OR

  • if no such condition or error exists, explains how the loop could be modified to cause an infinite loop
Consider the Personalized Project Reference and Written Response 2(a) when scoring this point.
  • If multiple iteration statements are included in the Procedure section of the Personalized Project Reference, use the first iteration statement to determine whether the point is earned.
  • The iteration statement does not need to be contained in a procedure to earn this point.
Do NOT award a point if the following is true:
  • The identified number of times the body of the iteration statement will execute does not match the code.
Row 5: Written Response 2(b) from prompt during Written Exam based on your [PPR]
Sample Prompt during Written Exam (last 60 min):
"Consider the procedure included in part (i) of the Procedure section of your PPR. Describe a change to your procedure that will result in a run-time error. Explain why this change will result in a run-time error."
 
Errors & Testing
 
0 or 1 point
The written response:
  • describes a change to the procedure that will result in a run-time error.
  • explains why the change will result in a run-time error
Consider the Personalized Project Reference and Written Response 2(b) when scoring this point.
  • If multiple procedures are included in part (i) of the Procedure section of the PPR, use the first procedure to determine whether the point is earned.
Do NOT award a point if the following is true:
  • A procedure is not identified in part (i) of the Procedure section of the PPR.
  • The response does not apply to the procedure in part (i) of the Procedure section of the PPR.
  • The response describes expected behavior that is implausible, inaccurate, or inconsistent witht the program.
Row 6: Written Response 2(c) from prompt during Written Exam based on your [PPR]
Sample Prompt during Written Exam (last 60 min):
"Suppose your are provided with a procedure called isEqual(value1, value2). The procedure returns true if the two parameters value1 and value2 are equal in value and returns false otherwise. Using the list you identified in the List section of your PPR, explain in detailed steps an algorithm that uses isEqual to count the number of times a certain value appears in your list. Your explanation must be detailed enough for someone else to write the program code."
Data and Procedural Abstraction
 
0 or 1 point
The written response:
  • explains in detailed steps an algorithm that uses isEqual to count the number of elements in the list that are equal to a certain value
Consider the Personalized Project Reference and Written Response 2(c) when scoring this point.
  •  
    If multiple lists are included in the List section of the PPR, use the first list to determine whether the point is earned.
  •  
    The algorithm can be described in code, pseudocode, as a sequence of steps in English, or as a paragraph in english.
  • The algoorithm must describe iterating over all the elements of the list, calling isEqual on each list element and maintaining a count of the number of list elements equal to a certain value
  • The algorithm must correctly determine the number of elements that are equal to a certain value. Some ways this can be determined is by storing the value in a variable, returning it, or displaying it to the user.
Do NOT award a point if the following is true:
  •  
    A list is not identified in the List section of the PPR.
  • The description of the algorithm is not detailed enough for someone else to write the code.

 

Archived (pre-2024) P0: Plan for the Create Task - The Programming Assessment
  • [30% of overall AP Score...minimum 12 hours of class time]
  • NOTE: You are NOT writing any programs at this time, you are simply reading about the expectations of the Create Task (Setup, Goals, Scoring) that must will be done later in the semester.

 

Before Create Task - Setup

Information you should keep in mind.

Do NOT do your "final" Create Task too early (it is due in April). You (and your peers) will be given several samples to practice writing and scoring using the rubric below. You will also develop a mini-Create task to be scored by a peer before March.

Your teacher CANNOT provide feedback or help score your real (or Final) Create Task prior to submission to the College Board.

Recommended due date is 15April but final due date is 30Apr.

Note: short, one-sentence answers are usually best.

 

During Create Task - Goals

Create Performance Task : online submission by 30April, 30% of AP CSP score

  1. [PC] Final Program Code (Independently or Collaboratively)

  2. [V] Video displaying running of student program and demonstrates functionality student developed (created independently)

  3. [IWR] Independently Written Response [750 word limit for combined written parts exclusive of Program Code] in 18 different text boxes with given prompts. Collaboration is NOT allowed.

      Part 3a. Provide a written response. Approx. 150 words combined in 3 subparts

      • i. Describe overall purpose. Why did YOU write the whole program?
      • ii. Describe functionality of program demonstrated in video. How does the program work as seen in your video?
      • iii. Describe input & output of program demonstrated in video

      Part 3b. Paste two program code segments that contains a list (or other collection type) being used to manage complexity. Approx. . 200 words combined in 5 subparts, exclusive of Code

      • i. Code segment that shows how data have been stored in the list
      • ii. A second code segment that show the data in the same list being used as part of fulfilling the programs purpose.
      • iii. Identify the name of the list.
      • iv. Describe what the data contained in the list represents.
      • v. Explain how the selected list manages complexity by explaining why program could not be written, or how it would be written differently, if the list was not used.

      Part 3c. Paste two program code segments that contains a procedure that implements an algorithm and a call to that procedure. Approx. 200 words combined in 4 subparts, exclusive of Code

      • i. Code segment developed by student that :
        • defines procedure's name and return type (if necessary)
        • Contains and uses one or more parameters that have an effect on the fuunctionality of the procedure
        • Implements an algorithm that includes sequencing, selection, and iteration.
      • ii. A second code segment that shows where the procedure is called.
      • iii. [with part iv] Describe in general what identified procedure does and how it contributes to the overall functionality
      • iv [with part iii] Explain in detailed steps how the algorithm implemented in the procedure works. Explanation must be detailed enough for someone else to recreate it.

      Part 3d. Provide a written response. Approx. 200 words combined in 3 subparts.

      • i. Describes two calls to the procedure identified in written response 3c. Each call must pass a different argument(s) that causes a different segment of code in the algorithm to execute.
        • First call:
        • Second call:
      • ii.Describes what condition(s) is being tested by each call to the procedure.
        • Condition(s) tested by the first call:
        • Condition(s) tested by the second call:
      • iii. Identifies the result of each call.
        • Result of the first call:
        • Result of the second call:

After Create Task - Scoring

Name _________________________________________________________________

  • Note: Official Scoring Criteria gives ony 1 point per Row.

  • Learning Objectives: CRD-2.B AAP-1.D.a AAP-1.D.b AAP-3.C AAP-2.H.a AAP-2.K.a CRD-2.J

Classroom Score

AP Score

ROW 1 : Program Purpose and Function [4.A]:

  1. Submit one Video [V] that demonstrates the running of at least one significant feature of your program.
  2. Submit three text prompts : Individual Written Response [IWR] ONLY in Section 3a:
  • Scoring Criteria:

    The video demonstrates the running of the program including:

    • input

    • program functionality

    • output

    The written response:

    • describes the overall purpose of the program.

    • describes what functionality of the program is demonstrated in the video.

    • describes the input and output of the program demonstrated in the video.

     

     

  • Decision Rules & Scoring Notes

    Do award the point if :

    • Consider ONLY the video and written response 3a when scoring this point.

    Do NOT award a point if any one of the following is true:

    • The video does not show a demonstration of the program running (screenshots or storyboards are not acceptable and would not be credited.)

    Notes:

    • Purpose means the intended goal or objective of the program.
    • Function means how the program works.

10 pts

1 pt

ROW 2 : Data Abstraction [3.B]

  1. Submit four text prompts : Individual Written Response [IWR] ONLY in Section 3b
  • Scoring Criteria:

    The written response : Consider ONLY written response 3b when scoring this point.

    includes two program code segments:

    • one that shows how data has been stored in this list (or other collection type).
    • one that shows the data in this same list being used as part of fulfilling the program’s purpose.
    4 pts

    identifies the name of the variable representing the list being used in this response.

    2 pts

    describes what the data contained in this list is representing in the program.

    6 pts
  • Decision Rules & Scoring Notes

    Requirements for program code segments:

    • The written response must include two clearly distinguishable program code segments, but these segments may be disjointed code segments or two parts of a contiguous code segment.
    • If the written response includes more than two code segments, use the first two code segments to determine whether or not the point is earned.

    Do NOT award a point if any one of the following is true:

    • The use of the list is trivial and does not assist in fulfilling the program’s purpose.

     

10 pts

1 pt

 

ROW 3 : Managing Complexity [3.C]

  1. Submit one text prompt : Individual Written Response [IWR] ONLY in Section 3b
  • Scoring Criteria:

    The written response : Consider ONLY written response 3b when scoring this point.

    includes a program code segment that shows a list being used to manage complexity in the program.

    5 pts

    explains how the named, selected list manages complexity in the program code by explaining why the program code could not be written, or how it would be written differently, without using this list.

    5 pts
  • Decision Rules & Scoring Notes

    Requirements for program code segments:

    • Responses that do not earn the point in row 2 may still earn the point in this row.

    Do NOT award a point if any one of the following is true:

    • The code segments containing the lists are not separately included in the written response section (not included at all, or the entire program is selected without explicitly identifying the code segments containing the list).
    • The written response does not name the selected list (or other collection type).
    • The use of the list is irrelevant or not used in the program.
    • The explanation does not apply to the selected list.
    • The explanation of how the list manages complexity is implausible, inaccurate, or inconsistent with the program.
    • The solution without the list is implausible, inaccurate, or inconsistent with the program.
    • The use of the list does not result in a program that is easier to develop, meaning alternatives presented are equally complex or potentially easier.
    • The use of the list does not result in a program that is easier to maintain, meaning

     

10 pts

1 pt

 

ROW 4 : Procedural Abstraction [3.C]

  1. Submit three text prompts : Individual Written Response [IWR] ONLY in Section 3c
  • Scoring Criteria:

    The written response : Consider ONLY written response 3c when scoring this point.

    includes two program code segments:

    • - one showing a student-developed procedure with at least one parameter that has an effect on the functionality of the procedure.

    • - one showing where the student-developed procedure is being called.

    6 pts

    describes what the identified procedure does and how it contributes to the overall functionality of the program.

    4 pts
  • Decision Rules & Scoring Notes

    Requirements for program code segments:

    • The procedure must be student developed, but could be developed collaboratively with a partner.
    • If multiple procedures are included, use the first procedure to determine whether the point is earned.

    Do NOT award a point if any one of the following is true:

    • The code segment consisting of the procedure is not included in the written responses section.
    • The procedure is a built-in or existing procedure or language structure, such as an event handler or main method, where the student only implements the body of the procedure rather than defining the name, return type (if applicable) and parameters.
    • The written response describes what the procedure does independently without relating it to the overall function of the program.

     

10 pts

1 pt

 

ROW 5 : Algorithm Implementation [2.B]

  1. Submit one text prompt : Individual Written Response [IWR] ONLY in Section 3c
  • Scoring Criteria:

    The written response : Consider ONLY written response 3c when scoring this point.

    includes a program code segment of a student- developed algorithm that includes

    • - sequencing

    • - selection

    • - iteration

    6 pts

    explains in detailed steps how the identified algorithm works in enough detail that someone else could recreate it.

    4 pts
  • Decision Rules & Scoring Notes

    Requirements for program code segments:

    • Responses that do not earn the point in row 4 may still earn the point in this row.
    • The algorithm being described can utilize existing language functionality or library calls.
    • An algorithm that contains selection and iteration, also contains sequencing.
    • An algorithm containing sequencing, selection, and iteration that is not contained in a procedure can earn this point.
    • Use the first code segment, as well as any included code for procedures called within this first code segment, to determine whether the point is earned.
    • If this code segment calls other student-developed procedures, the procedures called from within the main procedure can be considered when evaluating whether the elements of sequencing, selection, and iteration are present as long as the code for the called procedures is included.

    Do NOT award a point if any one of the following is true:

    • The response only describes what the selected algorithm does without explaining how it does it.
    • The description of the algorithm does not match the included program code.
    • The code segment consisting of the selected algorithm is not included in the written response.
    • The algorithm is not explicitly identified (i.e., the entire program is selected as an algorithm without explicitly identifying the code segment containing the algorithm).
    • The use of either the selection or the iteration is trivial and does not affect the outcome of the program.

     

10 pts

1 pt

 

ROW 6 : Testing [4.C]

  1. Submit 6 text prompts : Individual Written Response [IWR] ONLY in Section 3d
  • Scoring Criteria:

    The written response :Consider ONLY the written response for 3d and the selected procedure identified in written
    response 3c..

    describe two calls to the selected procedure identified in written response 3c.

    Each call must :

    • pass a different argument(s) that
    • causes a different segment of code in the algorithm to execute.
    6 pts

    describes the condition(s) being tested by each call to the procedure.

    2 pts

    identifies the result of each call.

    2 pts
  • Decision Rules & Scoring Notes

    Requirements for program code segments:

    • Responses that do not earn the point in row 4 may still earn the point in this row.

    Do NOT award a point if any one of the following is true:

    • A procedure is not identified in written response 3c or the procedure does not have a parameter.
    • The written response for 3d does not apply to the procedure in 3c.
    • The two calls cause the same segment of code in the algorithm to execute even if the result is
      different.
    • The response describes conditions being tested that are implausible, inaccurate, or inconsistent
      with the program.
    • The identified results of either call are implausible, inaccurate, or inconsistent with the program.

     

10 pts

1 pt

 

Classroom Requirement Only : Create Performance Task Submission Requirements:

  1. Submit one Video document, one Individual Written Response document, and one Program Code document.
  2. V - .mp4, .wmv, .avi, or .mov format and less than 1 minute

    -5 pts

    V and IWR - less than 30MB (together)

    -5 pts

    IWR - .pdf format

    -5 pts

    IWR - less than 750 words (not including CODE)

    -5 pts

    PC - Code: comments include sections that are attributed to another programmer.
    NOTE: Submissions may be given a Score of 0 if proper citation and attribution is not provided (i.e. plagarism)

    -5 pts

Classroom Deductions

AP CSP Scoring has no deductions

Create Project Score :

__/ 60 pts

__/ 6 pts

P1: Project 1 : Part I : Introduction to the Create Task

 

Learning Objectives - students will :

  1. Review P0 : Plan for the Create Task and specifically note issues in your Engineering Notebook in Project 1 anything you might need regarding plagiarism versus appropriate use and attribution of teamwork, free, and/or generative AI (ChatGPT) code. Make sure you have the Student Handout for the Create Task that was provided to you by your teacher.

  2. Copy the following scoring rubric into your Engineering Notebook for Project 1: [-5 pts if not included]

    1. [_____10pts] Record of the names of 5 assigned Videos on AP Classroom. Complete an ATTESTATION that you watched the videos by putting the DATE that you finished watching each video by the names of the videos.
    2. [_____20pts] Copy the LO's related to Create Task (as shown in the Video) with Highlighting of Terminology used to generate Questions on AP Exam in May.
    3. [_____20pts] Copy the Six Rows (i.e. 6 scoring points for Create Task) from the Scoring Guideline as shown in the Videos. 
    4. Complete a Personal Project Reference (PPR) that captures from Sample Create Task code provided by your teacher (i.e. Poker project uploaded to Schoology):
      1. [_____20pts] Two program code segments that contains student-developed Procedure that implements an algorithm and a call to that procedure.
      2. [_____20pts] Two program code segments that contains student-developed List being used (stored & accessed) to manage complexity in the program.
      3. [_____10pts] Remove any commenting. If any part of the PPR cannot be completed from the given Poker code, make a note of the reason why (i.e. "Student cannot use code as it was written by teacher" or "Code does not exist in Practice code provided.")
  3. Review the APClassroom assigned Instructional Videos to identify the various requirements that make up the Create Task's 30% score.

    1. Video: Create Performance Task: Overview (7 min)
    2. Video: Create Performance Task: Guidelines (12 min)
    3. Video: Create Performance Task: Pacing Your Project (11 min)
    4. Video: Create Performance Task: Categories and Questions (5 min)
    5. Video: Create Performance Task: Scoring Guidelines and Sample Written Response (20min)
  4. After watching the above Videos, in your Engineering Notebook for Project 1, copy the Learning Objectives (LO's) that will be used to generate questions regarding you Personal Project Reference (PPR) during the last hour of the AP Exam in May. Specifically highlight the following terminology/definition in the identified LO-EK's:

    1. Program: Design, Purpose, Function, Input, Output
    2. Algorithm: Sequential Statements, Conditional (or Selection) Statements, and Iteration statements,
    3. Error & Testing: Identify, Correct, Behaviors for Correctness or Incorrectnes of Input/Output
    4. Data and Procedural Abstraction: Storing, accessing and traversing a List, Managing Complexity using a List or Procedure with a parameter, Calling a Procedure with argument matching a parameter.
  5. Copy or write in your Engineering Notebook for Project 1, the six (6) different 0-1 point "Row"s from the Scoring Guideline that will be scored using your Personal Project Reference (PPR) requested below.

  6. Complete a practice Create Task : Video (V) and Personal Project Reference (PPR) using Sample Program Code given by your teacher that uses a language (Java) that implements a known algorithm, abstraction, List, and Procedure with parameter(s).

    1. Sample Program Code will be provided by teacher along with relevant commenting showing who wrote each part of the code:

      1. Deck.java : focus on the :
        1. Algorithms : "swap" basic algorithm or the "Bubble Sort" advanced algorithm with abstraction
        2. Data Structure : arrays as Lists
        3. Abstraction : methods & parameters as Procedures
      2. PokerGame.java : focus on the calling of the Deck.java code
      3. PokerPlayer.java : focus on the use of both Lists and Procedures.
      4. Card.java : focus on a simple Java Bean
    2. In your Engineering Notebook for Project 1 using the Sample Code provided by your teacher, complete the last 2 (of 3) Components for the practice Create Task that will generate the most number of points (maxiumum is six (6) points) from the Scoring Guideline. Note that the deails of these are specifed in the Student Handouts for the Create Task.

      1. Component A: Program Code (DO NOT SUBMIT the sample code provided by teacher including Deck.java, PokerGame.java, PokerPlayer.java, Card.java or images. DO NOT SUBMIT any additional code you may have written to run the program)
      2. Component B: Video fulfilling the requirements outlined in the Student Handout. (DO NOT SUBMIT for Project 1)
      3. Component C: Personal Project Reference (PPR) (using the Sample Code provided by your teacher)
        1. Capture & Paste in your Engineering Notebook two program code segments theat contains student-developed Procedure that implements an algorithm and a call to that procedure
        2. Capture & Paste in your Engineering Notebook two program code segments that contains student-developed List being used (stored & accessed) to manage complexity in the program.
        3. Remove any commenting.
  7. Submit your Engineering Notebook for P1: Project 1 : Introduction to the Create Task as a PDF. Retain your Video for future reference.

 

Note: Future options to develop and practice Create Tasks include:

  1. Project 4 : Internet : HTML & JavaScript
  2. Project 5 : Visualizations :Three Dimensional Programming using a Ray Tracer

P2: Project 2 : Numeric Systems & Math Theory : Binary, Octal, Decimal, & Hexadecimal

 

Summary :

Humans use numbers everyday. But what are numerals, number systems and how do we "use and communicate" via numbers?

Learning Objectives : Students will...

    Convert : Numerals and Bases Conversions

    Base

    Decimal (base 10)

    Binary (base 2)

    Hexadecimal (base 16)

    Octal (base 8)

    Example 1 - Convert each from Condensed Form to Expanded Form

    2579

    1010 0001 0011

    A13

    5023

    Example 2 - Convert from Hexdecimal (or Decimal)

    135


    87


    Example 3 - Convert from Binary (or Decimal)

    87

    0101 0111



    Example 4 - Convert from Hexadecimal (or Octal)



    CC02

    146002

    Assess : writing Exam Questions

    Write 4 (or 5) questions on any of the above lectures and/or practice problems that you would expect to see on an AP Exam...this must be done by noting the appropriate Essential Knowledge (EK) statement that matches your Test Question.

    1. Test Questions: Multiple Choice. Must include 5 (or 4) options and one (or more) correct answers.

    2. Test Questions: Short Answer with Solutions. May include fill-in-the-blank for longer questions.

    3. Test Questions: Free Response. Must require student to write a solution to a problem either by

      1. giving a programming code for students to read and understand, or
      2. giving a arithmetic problem in several bases requireing students to write multiple mathematical steps accurately and with precision.

    Explore : Topics I : Numeric and Number Systems

    [pick one from the following list]

    1. Kurt Godel's Incompleteness Theorem

    2. Irrational and Transcendent (i.e. non-algebraic or non-polynomial) Numbers

    3. HyperReal and HyperComplex Numbers, Superreal, Surreal Numbers, Rings, Fields, Quaternions, SuperNatural Numbers

    4. Lambda-Calculus & Computable Numbers

    5. Aleph Numbers - Cardinality (i.e. size) of Infinite Sets -

      • The Integers and the Natural Numbers have the same Cardinality (Aleph-null)

      • The Real Number System is "bigger" than the Integers (Aleph-one).

      • What has Cardinality greater than the Real Numbers?

    6. Rudy Rucker's Book - Infinity and the Mind

    7. First Fundamental Theorem of Arithmetic

    Details of short description

    • at least one fact with an inline citation that references at least one reliable and identifiable source placed as a footnote (this will be used to understand and avoid plagiarism in the course),
    • where/how it the topic is used or discovered,
    • the problem(s) the topic addresses (create at least one example math problem and solve the example),
    • Your description should be in 3rd person (no "I" or "you"), 1 page long, double-spaced, 12pt, Times New Roman.

    Explore : Topics II : Numeric Operations (Arithmetic)

    [pick one from the following list]

    1. Procedure(s) to multiply by other than the given base.

    2. Procedure(s) to divide by other than the given base.

    3. Negatives in Binary (2's complement procedure).

    4. Bitwise shifting operator by example (>>, <<, >>>, <<<)

    5. Use the decimal point to indicate when bases switch from positive exponents to negative exponents.

    6. Create a "times table" for Decimal, Binary, and for Hexidecimal digits.

    7. Program a Number System Calculator in Java & Swing

    8. Program a Number System Calculator in Javascript

    Details of short description

    • at least one fact with an inline citation that references at least one reliable and identifiable source placed as a footnote (this will be used to understand and avoid plagiarism in the course),
    • where/how it the topic is used or discovered,
    • the problem(s) the topic addresses (create at least one example math problem and solve the example),
    • Your description should be in 3rd person (no "I" or "you"), 1 page long, double-spaced, 12pt, Times New Roman.

 

Instruction : a series of 4 Lectures will be given :

    Lecture 1 : Numerals : how we write/communicate numbers.

    Example A - different ways to write the same Number (note: there are many more ways than the 8 listed here):

    1. 27 (Hindu-Arabic numeral system used in most modern societies)

    2. twenty-seven (English-language based numeral system - verbal communications)

    3. XXVII (roman numerals - old but not designed for computation)

    4. 0001 1011 (binary numerals - computer representations)

    5. ///// ///// ///// ///// ///// // (tally system - simple)

    6. one score and seven (English ala Lincoln)

    7. 00:27:00 (sexagesimal system - based on degrees:minutes:seconds) and one of the oldest numeral systems in existence. Ancient Babylonians used to compute time, geography, and angles...base-60 avoids many issues with fractions/division due to the First Fundamental Theorem of Arithmetic)

    8. 1B (hexadecimal system which uses the digits 0,1..9,A,B,C,D,E,F

    Example B - the numerals 0, 1, 2, and 3 in mathematical set-theoretic notation...uses only the three symbols: {,}

    • 0 = {},

    • 1 = {0} = {{}},

       

    • 2 = {0,1} = {{},{{}}},

    • 3 = {0,1,2} = {{},{{}},{{},{{}}}}

    Lecture 2 : Numbers : how we use numbers to count, measure, and label objects.

    1. When we use numbers to "count" objects, we are referring to the "cardinality" property.

    2. When we use numbers to compare ("bigger versus smaller") against objects, we are referring to the "comparison" property.

    3. When we use numbers to label objects (like the list below) we are referring to the "nominal" property.

    Usually we just talk about "Number Systems" which are sets of numbers.

    1. Natural Numbers (aka Counting Numbers)

      • If used to describe the "size" of an object then we call the number a Cardinal such as 5 bananas [five is the cardinality of the set of bananas].
      • If used to describe a property of an object for comparison purposes then we call the number a Measurement such as "I scored an 85% on the test." The 85% by itself does not mean anything unless we compare it to other scores. (If the measurement includes a magnitude and a unit--a word such as "meter"-- it is called a Quantity.)
      • If used only as a label rather than for any calculations, then the Number is a Nominal such as this listing or numbering of the definitions for Cardinal, Measurement, and Nominal...we could have just used a bulleted list instead of a numbered list.
    2. Integers - no fractions or decimals, includes positives, negatives, and 0.

    3. Rationals (i.e. Fractions) + Irrationals (i.e. non-terminating, non-repeating decimals) = Real Numbers

    4. Real + Imaginary = Complex Numbers (numbers that can go round-and-round)

    Lecture 3 : Numeral Base Systems : Decimal, Binary, Octal, and Hexadecimal Systems

     

    Commonly Used Numeral Systems in Computer Science are:

    Base

    Decimal (base 10)

    Binary (base 2)

    Hexadecimal (base 16)

    Digits (or Symbols)

    • A16 is 10 in decimal

    • B16 is 11 in decimal

    • C16 is 1 in decimal

    • D16 is 13 in decimal

    • E16 is 14 in decimal

    • F16 is 15 in decimal

    0, 1, 2, 3,..., 9

    0, 1

    0, 1, 2 ..., 9, A, B, C, D, E, F

    Condensed Notation

    499

    1 1111 0011

    • 1F3

    • [Hint: convert groups of 4 bits start at far right into 1 hexadecimal digit]

    Expanded Notation

    4*102 + 9*101 + 9*100

    1*28 + 1*27 + 1*26 + 1*25 + 1*24 + 0*23 + 0*22 + 1*21 + 1*20

    1*162 + F*161 + 3*160

    Converting to Decimal

    400 + 90 + 9

    256 + 128 + 64 + 32 + 16 + 0 + 0 + 2 + 1


    1*256+15*16 + 3

    Solution

    499

    499

    499

    Lecture 4 : Arithmetic Operations : Decimal, Binary, and Hexadecimal Systems

     

    Operation & Notes

    Decimal (base 10)

    Binary (base 2)

    Hexadecimal (base 16)

    Addition (+)

    1. Watch "carryover"

    • 132

      + 039 =

    • 171

    • 1000 0100 +

    • 0010 0111 =

    • ___________
    • 1010 1011


    • 8416 + 2716

      =

    • AB16

    Subtraction (-)

    1. Borrowing is a bit tricky.

    2. egatives are in Explorations.

    3. Subtraction is usually done using "adding by negatives" in binary

     

    • 132

      -

      039

      =

    • 93

    • 1000 0100 -

    • 0010 0111 =

    • __________
    • 0101 1101


    • 8416 - 2716 =

    • 5D16

    Multiply (*) by the Base Number

    1. Multiplying by a base just "left shifts" the digits

    2. Multiplying by digits other than the base is more complex and requires memorizing "times tables" for each base

     

    • 13 * 102 =

    • 13 * 100 =

    • 1300

    • 0000 1101 * 210 =

    • 0000 1101 * 102 =

    • 0001 1010

    • [hint: shift all bits left by 1 position, called "bit-shift" or << operator]

    • D * 16310 =

    • D * 100016 =

    • D00016

    Divide (/) by the Base Number

    1. Dividing by a denominator that is a power of the base system will simply "right shifts" the digits of the numerator

    2. Dividing by digits other than powers of the base systemis more complex and requires memorizing "times tables" for each base.

     

    • 128 / 101 =

    • 128 / 10 =

    • 12.8 =

    • 1*101+ 2*100 + 8*10-1

    • 1000 0000 / 2110 =

    • 1000 0000 / 102 =

    • 0100 0000


    • [hint: shift all bits right by 1 position, called "bit-shift" or >> operator]

    • 80 / 16110 =

    • 80 / 1016 =

    • 816

 

Scoring Rubric :

Name ________________________________

Points Assigned

Date Assigned: ____________

1. Convert Practice Problems

/ 20

 

2. Assessment - writing test questions [5 pts per question with answer]

/ 20

 

3. Exploration I - Topic is _________________________

a) description

b) at least 1 example math problem and solution (may be handwritten)

c) 3rd person, double spaced, 12-point Times New Roman, 1 page

d) fact with an inline citation to a reliable, identifiable source in footnote

/ 20

 

4. Exploration II - Topic is _________________________

a) description

b) at least 1 example math problem and solution (may be handwritten)

c) 3rd person, double spaced, 12-point Times New Roman, 1 page

d) fact with an inline citation to a reliable, identifiable source in footnote

/ 30

 

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

[MAY BE SCORED LATER IN COURSE]

/ 10

- 5 pts if late

TOTAL

NOTE: absence of inline citation to a reliable, identifiable source is ground for a ZERO on this section of project. College Board also imposes more strict penalties for plagiarism.

/ 100

Date Due: ________________

P3: Project 3 : Data Representation & Encodings : Numbers, Colors, Characters & IP

 

Summary :

  1. Computers store, retrieve and manipulate binary data.

  2. Humans use mathematics and other encoding systems (i.e. human-based languages) to represent information.

  3. Computer Scientists apply mathematics and other encoding systems (computer languages & protocols) to translate information into binary data to be processed by computers as well as decode the binary data into information that is useful for humans.

Learning Objectives : Students will...

    Explore : Topics I : binary encodings of numbers (select up to 2 topics for a maximum of 50 pts)

    1. Write a program that illustrates each of the 6 Sources of Errors. [50 points]

    2. Write a program that converts floating point numbers (doubles?) to binary and vice-versa. Do NOT use Java's Integer, Float, or Double classes to parse the input due to miscalculations. Do USE arrays or ArrayLists of digits and write your own parse method using Strings. [50 points]

    3. Write 5 floating point numbers in decimal and convert to IEEE754 binary representation. [5 points per number conversion, maximum 25 pts]

    4. Write 5 IEEE754 floating point numbers in binary and convert to decimal representation (5 points per number conversion, maximum 25 pts]

    5. List the IEEE754 floating point representations for the following unusual "numbers": NaN (not a number), 0, positive infinity and negative infinity. [25 points]

    6. Write 5 multiple-choice or short answer questions with correct answers for a test. Note which Essential Knowledge (EK's) statement(s) matches each question. [5 points per problem, maximum 25pts]

    Explore : Topics II : encodings of colors and text (select up to 2 topics for a maximum of 50 pts)

    1. Color Encodings [pick a maximum 1 of the following 5 options]

      1. Convert the following RGBA hexadecimal values: FFFFFFFF, 00000000, C0C0C000, 88000088, 00888888 into decimal and describe, in english, what color each represents. [ 4 pts each for max 25 pts]
      2. List the following colors in RGBA format using hexadecimal, decimal, and percentages: light-yellow, cyan, clear (no color), dark gray, light gray. [ 4 pts each for max 50 pts (Note: 4pts * 4 colors * 3 numbers = 54 pts)]
      3. List 5 examples for each of the 3 other color-encoding format/schema's besides sRGBA (i.e. CMYK, HSL, HSV) that are commonly used [3 pts each example, 5pts for clarity/organization, 50 pts max]
      4. Write a JavaScript or Java program to convert your own name (FirstLast) to a color schema (RGBA integer values) [50 pts].
      5. Write 5 multiple-choice-multiple-select or short answer questions with correct answers for a test. Note which Essential Knowledge (EK's) statement(s) matches each question. (5 points per problem)
    2. Character Encodings [pick a maximum of 1 of the following 10 options]

      1. Write your own name (FirstLast) in ASCII decimal and hexadecimal encodings [25 pts]
      2. Write your own name (FirstLast) in Unicode decimal and hexadecimal encodings [25 pts]
      3. List the first 32 values of the ASCII encodings and explain what any one of the devices (listed below) will do with each of those 32 characters. Hint: several will be ignored by the devices [25 pts]:
        1. printer,
        2. TTY device,
        3. braille reader,
        4. Computer (Unix-based OS)
        5. Computer (MS Windows-based OS)
        6. Internet protocol such as email/MIME, FTP, www or SMS
      4. List the 8 escape-codes in US-ASCII, and describe how they are used in a Java [25 pts]
      5. List the default text-based encoding that are used in XHTM, HTML5, MacOS, MS Windows, and Linux. [25 pts]
      6. Write a Java program using the 8 escape-codes [50 pts]
      7. Write a JavaScript program to convert 4-letter names to US-ASCII decimals. [50 pts].
      8. Write a JavaScript program to convert 4-letter names to Unicode binary. [50 pts].
      9. Write 5 multiple-choice-multiple-select or short answer questions with correct answers for a test. Note which Essential Knowledge (EK's) statement(s) matches each question. (5 points per problem)

    Explore : Topics III : encodings on the Internet (select 1 topics for a maximum of 50 pts)

    1. Addresses : List the IPv4 and IPv6 addresses of 5 common websites including www.ecusd7.org and www.meinzeit.com [25 pts]

    2. Convert : encode your own name (FirstLast) to Unicode values then to an IPv4 address. Note that there are multiple ways to accomplish this conversion. [25 pts]

    3. Identify : list 25 commonly-used PORT numbers, the services (i.e. programs) assigned to them, and their purpose. [25 pts]

    4. Identify : list 10 commonly used (or reserved) IPv4 addresses along with associated port numbers for a private network. For example: 192.168.0.1:53 is often the homeowners private router or host to the internet using port 53 (i.e. domain name service or DNS). [50 pts]

    5. Program : write JavaScript program to convert your own name (FirstLast) to Unicode values then to an IPv4. Note that there are multiple ways to accomplish this conversion. [50 pts].

    6. Synthesize : Write 5 multiple-choice or single-word questions with correct answers for a test. Note which Essential Knowledge (EK's) statement(s) matches each question.[5 points per problem, maximum 25 pts]

 

Instruction : a series of 3 Lectures will be given :

Lecture 1 : Binary & Introduction to Encoding Numbers


Computers

Humans

Numeral System

  • Binary: [two choices or options]

  • 0 or 1

  • FALSE or TRUE

  • ON or OFF

  • Decimal: 0,1,2,3,4,5,6,7,8,9 [ten choices]

  • Other Symbols/Notation: x, y, f(x), music, graphs

Physical Representations

  • switch (on or off)

  • hole/no-hole (DVD laser's burn a hole in the plastic disk

  • magnetic orientation (floppy disks and flash drives have a magnetic orientation that flips up/down or left/right when electrically charged)

  • Kinesthetically/touch - fingers, stepping to a beat

  • Visually - Hindu-Arabic writing system, tally marks, algebra, graphs

  • Auditory - speaking a language ("nine" or "neun"). Metronome

  • Taste - scoville units (habenaros), ?

Beginning Encoding


see...

  • Exact Encodings : Integers : int & long

  • 1 int = 4 bytes = 232 = 4294967296 (+/- 2 billion)

  • 1 long = 8 bytes = 264 = 1.844674407x1019


  • Approximate Encodings : Reals : float & double

  • 1 float = 4 bytes = 32 bits which are broken into 3 parts :

  • sign bit + exponent bits + mantissa bits:

  • 1 sign bit + 8 exponent bits + 23 mantissa bits

 

  1. 1 bit = 1 Binary digiT (2 options)

  2. 2 bits = 2 switches = 22 options = 4 choices = 00, 01, 10, 11

  3. 3 bits = 3 switches (23 = 8 options)

  4. 1 nibble = 4 bits = 24 options = 16 choices = 1 hexadecimal number

  5. 1 byte = 2 nibbles = 8 bits = 8 switches = 28 options = 256 choices = 2 hexadecimal numbers = 1 ASCII (alphabet) character

  •  
  •  

  • The 3 parts of a 32-bit real (float) encoding are used in an expression that generates an approximate value to the desired real number. The expression is:

  • (-1)sign x

  • (1+(mantissa/224)) x

  • 2(exponent - 127)

  •  
  •  
  • Example of IEEE 754 Encoding approximating a real number:

  • The real number, 0.085, is stored in 32 bits (i.e. a float in Java) using IEEE754 encoding as:

  • 0 01111011 01011100001010001111011

     

  • and broken down as:

    • 0 = sign bit = positive
    • 01111011 = exponent = 123
    • 01011100001010001111011 = mantissa = 3019899
  • so the expression becomes

  • (-1)0 x (1+(3019899/224)) x 2(123 - 127) =

  • 0.085000000894069671630859375

  • which is close to (approximately equal to) the intended 0.085 desired real number


  •  

    1 byte = 1 letter in the English alphabet (approximately) or

  • 1 byte can represent 255 different values often represented as two different ranges

    :
      1. between 0 and 255, inclusive
      2. between -128 and +127, inclusive

  • Note: REPRESENTATIONAL ERRORS lead to :

  • Accuracy Errors : This is a fundamental computational problem!

    [other errors lead to Accuracy errors as well such as incorrect measurements by humans]

     

     

  • Precision Errors : A Java float primitive is 6 decimal digits but it makes no sense to talk about precision when we are not accurate!

  • Example :

    Suppose Math.PI is represented by a new programmer as 3.133333 which has 7 digits of precision but is accurate only to the first 2 digits (i.e. 3.1).

     

     

  • Try Coding :

  • double x1 = 0.3;						   
  • double x2 = 0.1 + 0.1 + 0.1;						   
  • System.out.println(x1 == x2); 						      						     
                               
  • double z1 = 0.5;						   
  • double z2 = 0.1 + 0.1 + 0.1 + 0.1 + 0.1;						   
  • System.out.println(z1 == z2);  
  •   

Sources of Errors:

  1. Representations - 0.1 cannot be represented exactly in binary (unless infinite memory)

  2. Overflow (out-of-range) - int x = 2000 * 2000 * 2000

  3. Roundoff (use a tolerance for decimals when comparing...especially when different magnitudes)

  4. Accumulation (small errors tend to grow larger with large number of calculations)

  5. Measurement - assuming data coming in is exact is rarely correct.

  6. Loss of precision due to calculating small numbers from large numbers.

SUMMARY:

Assume you (and everyone else) are wrong!

  • Nominal Numerals

  • Order of Magnitude

  • Metric System

  • prefixes...short English form)

  • See : wikipedia "Orders of magnitude (numbers)

    "
  1. kiloByte = 210 = 1024 characters= 0.5 page of typed information

  2. megaByte = 220 =1048576 characters = 500 pages of typed characters = 1 ream of paper

  3. gigaByte = 230 =1073741824 characters = 500000 pages of typed characters = 1000 reams of paper = 10 cabinets = weight of 5 cars

  4. teraByte = 240 = 10,000 cabinets = 500 rooms = 1 high school full = weight of 5000 cars


  1. kilo = 103 = 1,000 = thousand

  2. mega = 106 = 1,000,000 = million = number of hours in the oldest person's life

  3. giga = 109 = 1,000,000,000 = billion = population of India in 2010. Number of IPv4 addresses on the Internet. Approximate number of webpages indexed by Google as of 2010. Counting to 1 billions would take about 100 years if you could take 3 seconds to say a single number.

  4. tera = 1012 = 1,000,000,000,000 = trillion = number of cells in a person's body (90% are human)

  5. peta = 1015 = 1,000,000,000,000,000 = quadrillion = different possible keys in the obsolete 56 bit DES symmetric cipher.

  6. exa = 1018 = 1,000,000,000,000,000,000 = quintillion = computational limit on a 64-bit computer [largest integer that can fit in a signed 2's complement form]. Also the password strength using 100-character set and a 10-character password. The volume of the earth's ocians in cubic meters.

  7. zetta =1021 = sextillion = number of 9x9 sudoku grids. Estimated number of grains of sand in the world's beaches or number of stars in the universe.

  8. ...

  9. 1027= octillion = number of unique Poker hands (Texas Hold-em). Number of atoms in the human body.

  10. 1036 = undecillion = 2128 number of IPv6 addresses (UUID). Total number of different possible keys in the AES 128-bit key space (symmetric cipher). Also the number of times the strength of electromagnetic interactions versus gravity.

  11. 10100= googol = 2128 number of permutations of a 6x6x6 Rubik's cube.


Lecture 2 : Encoding Colors and Characters (Text)

Color Encoding

Binary Representation

Decimal Representation

Notes

  • Simple Color using 1 byte

  • 0000 0000 = black

  • 0000 0001 = blue

  • ...

  • 1111 1111 = white

  • 0 = black

  • 1 = blue

  • ...

  • 255 = white

  • Non-natural as colors are broken down into components (i.e. purple is a combination of red + blue)

  • RGBA = red + green + blue + alpha (opaque/transparency)

  • Uses 4 bytes (32 bits) = 1 primitive int in Java

  • Also known as sRGB or standard RGB colorspace.

  • 1111 1111 (red) ,

  • 0000 0000 (green) ,

  • 1111 1111 (blue) ,

  • 1111 1111 (opaque)

  • dark purple (non-standard naming conventions)

  • 255,0,255, 255

  • or, in hexadecimal

  • FF,00,FF,FF

  • [note: usually Hexadecimal is written without commas and sometimes with a hashtag in front such as #FF00FFFF]

  • Opaque Dark Purple can be written as a:

  • vector <255, 0, 255, 255>

  •  

    or

  • percentage <1.00, 0.00, 1.00, 1.00>


http://colorschemedesigner.com

Character or Text Encodings

Binary Representation

Decimal/Hexadecimal Representation

Notes

  • 1. Simple Character using 1 byte

  • 0000 0000 = 'A'

  • 0000 0001 = 'B'

  • ...

  • 0001 1010 = 'Z'

  • 0 = 'A'

  • 1 = 'B'

  • ...

  • 25 = 'Z'


  • 238 values (26-255) are unused or unassigned. Memory wasted.

  • 2. US-ASCII character encoding using 7bits (published by ANSI organization).

  • Almost all modern computing devices use 1 byte (8 bits) called the UTF-8 encoding to store a US-ASCII character.

  • ASCII, for historical reasons, is a western-based language (often called Latin-1) representation and, therefore, not universal.

  • US-ASCII has been superseded by the Unicode which is backward compatible with US-ASCII

  • 0000 0000 to 0010 0000

  • are reserved characters

  • 0010 0001 = '!'

  • ...

  • 0011 0000 = '0'

  • ...

  • 0100 0001 = 'A'

  • 0100 0010 = 'B'

  • ...

  • 0101 1010 = 'Z'

  • ...

  • 0110 0000 = 'a'

  • 0 to 31 are reserved characters

  • 32 = space bar

  • 33 ='!'

  • ...

  • 48 = '0'

  • ...

  • 64 = '@'

  • 65 = 'A'

  • 41 = 'A' in hexadecimal

  • ...

  • 90 = 'Z'

  • 5A = 'Z' in hexadecimal

  • ...

  • 96 = 'a'

  • ...

  • 127 = delete key (or rubout key)

  • To actually understand file storage and network transmission, understanding of ASCII values 0-31 are IMPORTANT!

  • What character is the 007 encoding reserved as? Hint: only 1 of these!


  • Some ambiguity, especially in Operating Systems, still exists such as the 'LF' and 'CR' characters.

  •  

  • The decimal digits are encoded as characters using 48-57.

  •  

  • Capital letters come before lower case letters (or lowerCase > upperCase)

  •  

  • 127 is last assigned text representation...128-255 were left for expansions

  • 3. Unicode is the abstract encoding and representation of text/writings. It currently allows up to 1,112,064 characters.

  •  

  • UTF-16 is the actual binary-character encoding and is defined as 16 bits (216 = 65536 possible characters). Note: Originally, the 16 bits were broken into 2 bytes. However, use of 8-bit "bytes" is no longer require in UTF-16.

  •  

  • Unicode 2.0 has expanded to more than 2 bytes (16 bits) but maintains backward compatibility.

  •  

  • For example, two UTF-16 2-byte 'characters' (i.e. 4 bytes=32 bits) combine to make another single character. This allows Unicode to include more esoteric characters such as mathematical notations, music notations, or Egyptian Hieroglyphs

  • One byte of Unicode is identical to UTF-8 (US-ASCII).

  •  

  • But byte-order is not specified so must include "endianness" information that this UTF-8 single byte specifies either "left-end" or "right-end" encoding.







  • Normally a Unicode code point is referred to by writing "U+" or a "/u" followed by a hexadecimal number.

  •  

  • Java uses escape characters such as U+0041 or /u0041 to store the primitive literal char 'A'

  •  

  • Examples of Unicode backwards compatible with UTF-8:


  • U+0000 = null

  • U+0041 = 'A'

  • U+005A = 'Z'

  •  

    Example of incompatibilities with US-ASCII:

  •  

    U+20AC = €

    = Euro

  • or decimal #8364 = €

  • (equivalent to dollar sign in USA).

  • Java and HTML5 both CAN use Unicode (UTF-16) encodings.

  •  

  • UTF-8 encoded files are still the most common for legacy reasons.

  •  

  • UTF-16 (and Unicode) files cannot be "read" by older programs (i.e. written in C). Therefore storage and transferability is compromised.

  •  

  • However UTF-8 files are not fully "internationalized" because they cannot store non-Latin-based languages which is most of the world's writings.



Lecture 3 : Encodings on the Internet : Ethernet, IP Addresses, Transmission Control Protocol(TCP/UDP), Domain Name Service (DNS) and the IETF

Top Level View - Network Models (OSI) & Network Topologies

(numerous abstractions)

Very Low Level View - Numeric (bytes)

(little to no abstractions)

Mid-Level View - Frameworks

(some abstractions)

Ethernet (eth0) Encoding

Numeric

Notes

  • Every physical device (network card or NIC) that communicates has a unique number (ID) imbedded onto the device so that it can be identified by other physical devices on a physical connection.

  • This ID is called the Media Access Control (or MAC) Address.

  • 48 bits long = 6 bytes = 281,474,976,710,656 different possible devices

  • FRAMEWORK FOR :

  • bytes -> MAC Addresses -> TCP/IP -> Data

  • The MAC address represents the "lowest" level of connection (i.e. physical) between devices and is the 1st level of network abstraction

  • IEEE 802 specifications also have "EUI-48", and "EUI-64" ID standards because the"lifetime" of MAC addresses is about 100 years before is is expected to run out of unique devices ID's.

Internet (IP) Encoding

Numeric

Notes

  • IPv4 addresses are now defined as 32 bits which can encode up to 232 = 4 billion addresses

  •  

  • These 4 bytes were broken into sub-network "classes" = network+hosts (or computers)

  • Private/personal IPv4 addresses can connect to the Internet by using NAT's (network address translation) that route (i.e. router) or changes private IP addresses to publicly accessible IP addresses)



  • Example:

  • 8.8.8.8 is Google.com's public IPv4 address for it's computers that run the DNS protocol


  • Private networks (i.e. Local Area Network or LAN, intranet) ranges include:

  • 192.168.0.0 - 192.168.255.255 if your network is to have 65536 (=216) hosts/computers which is usually done using a home router.

  •  

  • 172.16.0.0 - 172.31.255.255 if your network is to have 1 million (=220) hosts/computers

  • 10.0.0.0 - 10.255.255.255 if your network is to have 16 million (=224) hosts/computers

  • 4 bytes usually written using "dot notation:


  • Range of possible IPv4 addresses is

    :
  • 0.0.0.0 to 255.255.255.255


  • IPv4 addresses are converted to text-based addresses by the DNS (domain name service) protocol/program.



  • IPv6 addresses are 128 bits usually written in hexadecimal format which implies 16 bytes (128 = 16bytes*8bits/byte)


  • Number of addresses is 2128 = 3.403x1038


  • The 128-bit IPv6 addresses are configured into various "bit groups" depending on the 3 different network classes/purposes:


  • 1. Multicast - deliver IP packet from one group of hosts/computers to distribute to other group(s)


  • 2. Unicast - deliver IP packet to one hardware interface/computer


  • 3. Anycast - deliver IP packet to a group of interfaces to be delivered to one host. Same bit group as unicast so cannot be distinguised


  • Format of IPv6 local address:


  • fdxx:xxxx:xxxx:yyyy:zzzz:zzzz:zzzz:zzzz


  • or, equivalently


  • fdxx:xxxx:xxxx:yyyy::/64


  • where:

  • 1. global ID (random) is 48 bits xx:xxxx:xxxx

  • 2. subnet ID is 16 bits yyyy

  • 3. Interface ID is 64 bits (as specified by the /64) zzzz:zzzz:zzzz:zzzz



  • Example of www.google.com's IPv6 address for it's DNS server computers (recall all numbers are in hexadecimal)


  • 2001:4860:4860:8888:0000:0000:0000:0000


  • The last significant 4 bytes (8888) are the same as IPv4!


  • Private Addresses start with unique local addresses (ULA) routing prefixes:


  • Example for a Unique Local address:


  • 0000:0000:0000:0001

  • or

  • fd12:456:789a:1::1
  • Note the double colon can be used once to "condense" multiple zeros


  • Unicast/AnyCast format:

  • 1. routing prefix = first 48 bits (or more)

  • 2. subnet ID = next 16 (or fewer) bits

  • 3. interface ID = last 64 bits


  • Note: the first 64 bits of the routing prefix + subnet ID are called the "network prefix"


  • General Multicast format:

  • 1. prefix = first 8 bits

  • 2. flag = next 4 bits

  • 3. scope field = next 4 bits

  • 4. group ID = final 112 bits


  • Note: If the prefix starts with the first ten bits being 1111111010.... = fe??:: indicates if the IPv6 address is a link-local address which should not be used on the Internet in general because they are non-routable.


  • Typically, the last 8 bytes (trailing zeros) can be omitted.

  • Also, :: usually means to assume all other values after (or between) are zero.

  •  

    Leading zeros in each 16-bit field are suppressed. For example, 2001:0db8::0001 is rendered as 2001:db8::1, though any all-zero field that is explicitly presented is rendered as 0.

  • "::" is not used to shorten just a single 0 field. For example, 2001:db8:0:0:0:0:2:1 is shortened to 2001:db8::2:1, but 2001:db8:0000:1:1:1:1:1 is rendered as 2001:db8:0:1:1:1:1:1.

  • Representations are shortened as much as possible. The longest sequence of consecutive all-zero fields is replaced by double-colon. If there are multiple longest runs of all-zero fields, then it is the leftmost that is compressed. E.g., 2001:db8:0:0:1:0:0:1 is rendered as 2001:db8::1:0:0:1 rather than as 2001:db8:0:0:1::1.

  • Hexadecimal digits are expressed as lower-case letters. For example, 2001:db8::1 is preferred over 2001:DB8::1.

  • Other Local/Private Addresses:

  • fec0::/10 - deprecated since "site" is poorly defined and routing confusion was generated.


  • fe80::/10 or /64 - this is a link-local address that must be on the same link (ethernet) and are not unique and therefore cannot be used directly on the Internet. Allows for "neighbor discovery protocal NDP for devices to communicate directly with each other.

Scoring Rubric :

Student Name: _____________________________________________

 

Exploration I (Numeric Encodings - IEEE754)

Topic and number _____________________________________________

Topic and number _____________________________________________

max 50

Exploration II (Color or Text Encodings)

Topic and number _____________________________________________

Topic and number _____________________________________________

max 50

Exploration III (Internet Addressing & Protocols)

Topic and number _____________________________________________

max 50

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

max 10

Project Total

max 100

 

P4: Project 4 : Higher-level Protocols on the Internet, Objects, and Languages

HyperText Transfer Protocol (http), HyperText Markup Language (HTML), Document Object Model (DOM), and JavaScript as overseen by Internet Engineering Task Force (IETF)

 

Learning Objectives - students will:

  1. Learn the basics of HTML tag structure & Document Object Model (DOM) :

  2. Learn the basics of Javascript programming language as used in HTML & programmatically manipulating the DOM :

  3. Learn the basics of Swapping, Looping, Conditionals, and Functions in Javascript within HTML :

 

Scoring Rubric :

 

Name ______________________________

Student Score

Possible Maximum Score

I.

HTML

-- Find Learning Objective (LO) associated with HTML tags

-- Create an HTML comment tag identifying and addressing one Essential Knowledge (EK) statement from

-- Create a paragraph (i.e. <P> tag) with an id attribute of "idCSN2A" identifying and addressing a 2nd EK

-- CIRCLE in pen the id attribute and and mark with a"I".

 

20

II.

HTML

-- Find Learning Objective (LO) associated with HTML tags

-- Create a header tag with a class attribute of "classLO" and innerHTML identifying and addressing on EK

-- Create a 2nd header tag with a class attribute of "classLO" and innerHTML identifying and addressing

-- CIRCLE in pen the two class attributes and mark with a"II".

 

10

III.

DOM & JavaScript :

---- Find Learning Objective (LO) associated with HTML tags and write a JavaScript comment identifying and addressing an EK

-- Write and call a JavaScript function that manipulates the DOM via id="idCSN2A" attribute.

-- Write and call a JavaScript function that manipulates the DOM by changing the background color of all tags with the class="classLO" attribute.

-- CIRCLE in pen the relevant JavaScript and mark with a "III".

 

20

IV.

Basic Algorithm: Swap.

CIRCLE in pen the relevant JavaScript and mark with a "IV".

 

10

V.

Basic Algorithm: Conditional.

CIRCLE in pen the relevant JavaScript and mark with a "V".

 

20

VI.

Basic Algorithm: Loop [include a comment about any other algorithm that was used within the body of the loop].

CIRCLE in pen the relevant Javascript and mark with a "VI".

 

20

 

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

-- Use appropriate indenting in your HTML and JavaScript code/printout.

 

10

 

TOTAL

 

100

 

Instructional Design Technique

  1. Demonstration and discussion of each objective via webpage using a browser and text editor (for source code)

  2. Demonstration of an advanced JavaScript program (analog clock)

    1. Debugging Hint: learn to use the debugging tool (F12) built into every browser...especially useful in Firefox and Chrome.
    2. Debugging Hint: instead of System.out.println("...") in Java, use console.log("..."); in JavaScript
    3. Debugging Hint: in the browser Debugging Tool (F12), learn to use the Console to identify JavaScript errors, network errors, CSS errors, security issues, and console output (from console.log() method)
  3. Online resources & references

Assessement Technique

  1. Informal feedback during demonstration & discussion.

  2. HTML + Javascript webpage assignment. Each student will select a webpage to create (HTML+Javascript) to accomplish goals agreed upon by instructor...tied to identifying and explaining one or more Essential Knowledge statements.

    1. Instructor will guide the student assignment to require an artifact (webpage) that demonstrates student learning of each objective in an original way.

    2. Instructor will guide the student assignment to avoid excessively difficult artifact that is clearly beyond the student's current ability.

    3. Instructor will guide the student assignment to avoid "simplistic" artifact (i.e. mere copying of demonstration) that does not provide any clear evidence of student learning.

    4. Student will read Learning Objective 6.3.1 and write HTML and JavaScript comments identifying and addressing two of the Essential Knowledge statements

  3. The following must be demonstrated by each student:

    1. Creating a basic webpage using HTML including an HTML comment

    2. Creating an "id" and "class" attribute within 2 or more HTML tags

    3. Manipulating the HTML tags containing one or more "id" and "class" attributes programmatically via Javascript including JavaScript comments.

    4. Write the following algorithms (methods/functions) using Javascript to manipulate the DOM

      • swap

      • loop

      • conditional (if...then...)

Specifications

  • Turn in the HTML & Javascript source code on disk or printout

  • Print out this grading rubric.

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

    • NOTE: JavaScript comments are similar to Java but HTML comments are actually tags (i.e. <!-- ... -->)

P5: Project 5 : Three Dimensional Modeling and Visualization usinga RayTracer (Pov-Ray)

[using a scene description language to create images]

 

Learning Objectives - Students will :

  1. become familiar with a scene-description programming language used in a ray-tracer [PovRay.org] to create photo-realistic 3 dimensional images.

  2. create a sequence of increasingly complex programs to learn the fundementals of a scene description language

  3. write traditional computer language algorithms such as loops, conditionals, variables and abstract constructs (objects)

  4. investigate more complex and abstract 3 dimensional mathematical constructs such as animations (time-dependant) or constructive solid geometry

 

Scoring Rubric

Name ________________________________

Approval

 

Image # 1 - box, sphere, plane, cylinder;

X

30

Image # 2 -
description:

 

30

Image # 3 -
description of advanced feature:

 

30

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

 

10

Project Total

100

 

Instructional Design Technique :

  1. Illustration of the Hall-of-Fame winners hosted at http://hof.povray.org/

  2. Demonstration of a basic scene description program featuring:

    1. Setup : Camera, Light Source, and a Plane with color and translation
           camera 
           {
               location <-5,3,-20> 
               look_at <0,0,0> 
      } light_source { <0,10,-10> rgb <1,1,1> } plane { 1*y, -1 pigment { color rgb<0,1,0> } translate <0,-2,0> }
    2. Declarations and invocation of variable representing objects. Constructive Solid Geometry (CSG)
           #declare myBox = box 
           {    
                 <-1,-1,-1> <1,1,1> 
                 pigment 
                 {  
                     color rgb<1,0,1> 
                 } 
           }
           #declare mySphere = sphere{ <0,0,0>, 1.25 pigment{color rgb<1,0,0> }}
           myBox     // call or draw myBox
           mySphere  // draw mySphere
      
           // Consructive Solid Geometry (CSG)
           #declare cutOut = difference {
                  object {myBox} 
                  object {mySphere} 
           }
           object {cutOut, translate<-5,0,0>} // draw the difference between myBox and mySphere
                              
    3. Use of a loop construct [algorithms]
        #declare ycnt = 0;
        #declare xcnt = -5;  // INITIALIZE the Loop Control Variable (LCV)   
        #while(xcnt < 10)    // TEST the LCV
            object 
            { 
              cutOut  // declared before as a difference of myBox-mySphere
              translate<xcnt,ycnt,0>    
              rotate <0,ycnt*10,0>
            } 
            #declare ycnt = xcnt*xcnt + 1; // calculate the parabola
            #declare xcnt = xcnt + .25;    // UPDATE the LCV
        #end 
                     
    4. Use of macro (i.e. procedure) with parameters, vector/list, and algorithm
      
      camera { location <-7,3,-7 > look_at < 0,0,0> } 
      
      light_source { < 0,10,-10> rgb < 1,1,1> }  
      
      plane { 1*y, -1 pigment { color rgb <0,1,0 >} translate <0,-2,0 >}
      cylinder { <-10,0,0 > <10,0,0 > .1 pigment{ color rgb <1,0,0 >}}
      cylinder { <0,-10,0 > <0,10,0 > .1 pigment{ color rgb <0,1,0 >}} 
      cylinder { <0,0,-10 > <0,0,10 > .1 pigment{ color rgb <0,0,1 >}}    
      
      #declare ball = object {sphere{ <0,0,0 >, 0.05}};
      
      /**
      * Declaring a macro called "sphereVector" is a procedure or method
      * with parameters (i.e. variables)
      * that can be used anywhere in the macro.
      * PARAMETERS:
      * c1 is a color vector in the form <r,g,b>
      * xs is a number that represents the starting x-coordinate of the image
      * ys is a number that represents the starting y-coordinate of the image
      * Zs is a number that represents the starting Z-coordinate of the image
      */ #macro sphereVector(c1,xs,ys,zs,num) #local EndXcoord = num+xs; #local EndYcoord = num+ys; #local EndZcoord = num+zs; #local Xcoord = xs; #while (Xcoord < EndXcoord) #local Ycoord = ys; #while (Ycoord < EndYcoord) #local Zcoord = zs; #while (Zcoord < EndZcoord) object { ball translate <Xcoord*0.5 Ycoord*0.5 Zcoord*0.5> #if ((Ycoord > 5) & (Zcoord >-3))
      pigment {color rgb c1}
      #else
      pigment {color rgb c1+<0,1,0>} // add colors
      #end } #local Zcoord = Zcoord + 1; #end #local Ycoord = Ycoord + 1; #end #local Xcoord = Xcoord + 1; #end #end // this macro can be called sphereVector(<0,0,1>,0,0,0,10) //blue, starting at <0,0,0> with a "10-ball" cube
      sphereVector(<1,0,0>,-5,-2,-6,3) //red, shifted <-5,-2,-6> with a "3-ball" cube
      sphereVector(<1,0,1>,-5,4,7,4) //purple, shifted <-5,4,7> with a "4-ball" cube
    5. Use of animation (i.e. clock variable, frames, and ini files)
      • PovRay does NOT do animation directly. Instead, PovRay will automatically generate a sequence of images (i.e. image1.gif, image2.gif, etc.) called frames using a special automatic "clock" variable. In order for PovRay to generate multiple frames, a separate file called an "ini" file specifies the PovRay file to generate as well as specifying the number of frames and the start/stop clock timings.
      • The code below shows the two files (i.e. animationPOV.pov and animationINI.ini). Note that the animationINI.ini file has a different syntax and structure than the animationPOV.pov file. As well, the animationINI.ini file specifies the number of frames and start/stop clock variable as well as "running" the animationPOV.pov file. The animationPOV.pov file uses the "clock" variable to change aspects on a per-frame basis.

      This is the animationINI.ini file : specifies frames, and clock start and stop times as well as input and ouput files.

      ; this is an INI comment (semicolon)
      ; this file should be saved as "animationINI.ini" for use in POVRay
      Initial_Frame = 0 ; matches clock variable so clock step per frame
      Final_Frame = 10 ; = 1.0/(Final_Frame-Initial_Frame) = 1/10
      Initial_Clock = 0.0 ; keep default = 0.0 and have PovRay file use a different startClk
      Final_Clock = 1.0 ; local variables (like endClk) to control actual animation
      Output_File_Name= animation.png ; files named animation0 to animation10
      Input_File_Name = animationPOV.pov ; PovRay file to render

      This is the animationPOV.pov file : uses clock variable to control values for translating, rotating, and color over time

         // This is the animationPOV.pov
         camera { location <-7,10,-20 > look_at < 0,0,0> } 
      light_source { < -7,10,-20> rgb 2*< 1,1,1> }

      /* The following includes use of the clock variable in a translation up, rotate around y-axis and
      * changing colors (light purple to dark purple */
      #declare startClk = 1.0; // assume animationINI.ini file specifies clock variable going from 0.0 to 1.0
      #declare endClk = 10.0; // controls what time will myClock end at
      #declare myClock = startClk + (endClk-startClk)*clock; // scale the clock variable
      // now declare our objects and apply myClock to the animation #declare ball = object {sphere{ <0,0,0 >, 0.5}};
      object {ball translate<0, 10-myClock, 0> rotate<0,36*myClock,0> pigment{color rgb<2/myClock,0,2/myClock>}}
      // show the ground and 3 axes
      plane { 1*y, 0 pigment { color rgb <0,1,0 >} translate <0,-5,0 >}
      cylinder { <-10,0,0 > <10,0,0 > .1 pigment{ color rgb <1,0,0 >}} // x-axis is red
      cylinder { <0,-10,0 > <0,10,0 > .1 pigment{ color rgb <0,1,0 >}} // y-axis is green
      cylinder { <0,0,-10 > <0,0,10 > .1 pigment{ color rgb <0,0,1 >}} // z-axis is blue
  3. Illustration of Advanced modeling & visualization techniques [i.e. advanced algorithms] hosted at:

    1. Germany - Tutorials & Examples - Friedrich A. Lohmueller
    2. Japan - Gallery with Examples - Tsutomu Higo

Instructions :

  • Using the POV-Ray program and the scene description language, create a series of 3 dimensional graphic images.

  1. The first image should be an include: 1) box, 2)plane 3) sphere, and 4) cylinder. You may use Mr. Meinzen's website and POV-Ray tutorial for help or generate your own.

  2. The 2nd image requires a more complex design of your choice. Discuss and get prior approval from Mr. Meinzen before starting. The 2nd image will require the use of at least one of each of the following algorithms: loop, conditional (if...then), variable declaration, and declared object. Specify in your code's comments how you used abstraction and algorithms within your 2nd image.

  3. The 3rd image(s) may be either an animation or require a complex POV-Ray mathematical feature...see below. Discuss and get prior approval from Mr. Meinzen before starting. Specify in your code's comments how you used abstraction and algorithms within your 3rd image.

Specifications :

  • First image due within 3 days of assignment

  • 2nd and 3rd images due as discussed and approved by Mr. Meinzen

  • Alternative images / graphics and grading may be allowed with discussion and approval by Mr. Meinzen.

  • A Hardcopy (i.e. printout) of the above rubric, your source code, and image is to be turned in for Mr. Meinzen to score.

  • Commenting, indenting and choice of appropriate variable names will be included in the scoring.

  • Any student who loses or does not get pre-approval before an image is due will receive only 50% credit.

Notes

Educational Websites

2nd Image Ideas

3rd Image Ideas

  • constructive solid geometry (merge, union, difference, etc.)

  • animation

  • while loops, conditionals, defined variables, defined objects

  • mathematical constructions (i.e. parabaloids, surface of revolutions, etc.)

 
  • blob and translucent objects

  • fractal

 
  • matrix to "shear" shapes

  • polynomial (coefficient matrix)

   
  • texture maps

Big Projects for 2nd & 3rd images

 

Other Computational Science Projects

 

Look at each the following decision-making algorithm as applied to life-choices. Investigate one topic and write a single-page paper illustrating how the algorithm is used in your (or your family's) life.

 

Synopsis of Algorithms to Live By: The Computer Science of Human Decisions by Brian Christian and Tom Griffiths.
  1. Choosing only the Best: when to stop looking and decide... the "37% Rule"
    1. Situation: We have to make a single "best" decision out of several potential choices. Unfortunately, we can only select or reject each choice one at a time before we can consider the next choice.
    2. Computer Science Perspective: "Optimal Stopping Algorithm" and "Secretary Problem"
      1. Estimate the total number of options (or estimate time spent looking/waiting or estimate the "cost" of looking/waiting).
      2. Do not select the first 37% (actually the percentage is exactly 1/e) of the options and, instead, learn from the first 37% of those options (called: .
      3. After learning as much as you can from the first 37%, choose the first option that is "better" than any of the first 37% you've already seen.
    3. Real-life Example:
      1. You want to buy a house in a "hot market" and another person may buy the house later that day. How do you decide to make an offer on the "best" house? If you wait too long, you will lose the house to another buyer.
      2. Interviewing candidates one-at-a-time and deciding whether to offer a job to them or to look at the next candidate?
      3. You can date as many people as you like but only one at at time. How do you decid which person to marry?
      4. You want to sell your house but can only consider one offer at a time. How do you determine to accept a "good" offer or wait for a possible 'better" offer?
      5. When you are deciding on a parking space in a crowded lot, do you select the first free spot or keep driving to get a potentially better spot?
  2. Choosing Latest versus the Greatest: when to explore new options and when to use the known favorites
    1. Situation: We have to decide when new experiences should be chosen over a existing favorites. Should we go to a new restaurant or an old favorite restaurant?
    2. Computer Science Perspective: Use the "Win-Stay Lose-Switch Algorithm", "Bandit Problem", and "Prisoner's Dilemma" to minimize regret. Or, for more complicated decisions, use a "Gittins Index" which stands for "git while the gittens good."
    3. Real-life Example:
      1. For "better-than-random" choices: You are at a casion using a gambling machine (one-armed bandits). You should keep using the same machine until you lose. When you lose the first time, you switch to another machine and keep playing it until you lose. Then switch to a 3rd machine, and so on.
      2. When to try a new selection: You have a favorite restaurant but, at the first bad meal, you switch to another new restaurant.
      3. When deciding to leave a well-paying job for a risky adventure, consider which option-when you are 80-years-old-would cause you to have the least regret...the minimal regret option becomes your decision
      4. In clinical trials, hisorically two groups are created. One is a control group that receives a plecebo (fake pill) will the other group is the expermental group that gets the new medicine. After a set period of time, the results of each group are analyzed to determine the likelihood of the effect of the medicine.
        However, this may be immoral in life-and-death situations such as new treatments to save babies lives. A newer statistical approach is to use "adaptive" trials. See ECMO research and the "Tuskegee Suyphilis Study"
  3. Making Order out of Chaos: when to keep things sorted and when not to sort
    1. Situation:
    2. Computer Science Perspective:
    3. Real-life Example:
  4. Forget about it: when is too much information not worth keeping
    1. Situation:
    2. Computer Science Perspective:
    3. Real-life Example:
  5. First things First: why we set priorities
    1. Situation:
    2. Computer Science Perspective:
    3. Real-life Example:
  6. Predicting the Future: using Bayes's Rule
    1. Situation:
    2. Computer Science Perspective:
    3. Real-life Example:
  7. Overfitting to the Data: when to stop thinking so hard
    1. Situation:
    2. Computer Science Perspective:
    3. Real-life Example:
  8. Relaxation: when to make things easier by loosening the rules
    1. Situation:
    2. Computer Science Perspective:
    3. Real-life Example:
  9. Randomness: some things are best left to chance
    1. Situation:
    2. Computer Science Perspective:
    3. Real-life Example:
  10. Networking: how do we connect
    1. Situation:
    2. Computer Science Perspective:
    3. Real-life Example:
  11. Game Theory: looking into the minds of others
    1. Situation:
    2. Computer Science Perspective:
    3. Real-life Example:
  12. Computational Kindness: going easy on others
    1. Situation:
    2. Computer Science Perspective:
    3. Real-life Example: