Back

Activity 1.1: Welcome to AP CSP

divider

Activity 1.1

Welcome to AP CSP

Key Concepts

What This Course Is

How You Are Assessed

Your First Program

You Do Not Need Any Experience

This course starts from nothing.

You Do Not Need Any Experience

This course starts from nothing.

Some people in this room have written code before. It will not matter by October.

Nothing this year assumes you took another computing class.

What Is Computer Science Principles?

Not just programming.

How computers store things, how the internet works, what algorithms cost, and what computing does to people.

Programming is how we investigate it.

The Five Big Ideas

  • Creative Development
  • Data
  • Algorithms and Programming
  • Computer Systems and Networks
  • Impact of Computing

Every activity this year belongs to one of these.

How You Are Assessed

Two parts, and they are nothing alike.

How You Are Assessed

Two parts, and they are nothing alike.

  • 70 multiple-choice questions in 120 minutes — 70% of your score
  • The Create Performance Task — 30%

That is about a minute and forty seconds per question.

The Create Task

A program you design and build yourself.

The Create Task

A program you design and build yourself.

You build it in this room, in Quarter 3, over eight sessions.

The Create Task

A program you design and build yourself.

You build it in this room, in Quarter 3, over eight sessions.

Then on exam day you answer four written prompts about it in 60 minutes, with no computer in front of you.

Which Is Why the Code Is Yours

All code you submit must be entirely your own.

In May you sit in a room with your own program and explain how it works, from memory.

Code you did not write cannot be explained under those conditions.

What Is a Program?

A list of instructions, carried out in order.

The computer does exactly what the list says. Exactly is the part that will annoy you.

Your First Program

io.write("What is your name? ")
local name = io.read()
print("Nice to meet you " .. name)

Your First Program

io.write("What is your name? ")
local name = io.read()
print("Nice to meet you " .. name)
Terminal window
What is your name? Sam [Enter]
Nice to meet you Sam

Reading One Line

print("Nice to meet you " .. name)
  • print — put this on the screen
  • Quotes — everything inside is text, exactly as typed
  • .. — join two pieces of text together

Today's Objectives

  • Open the workspace and run a program
  • Copy a template and rename it
  • Change what a program prints
  • Say what the Create Task is and when you build it

Key Terms

Program
A list of instructions a computer carries out in order.
print
The instruction that shows a line of text.
Template
A starting folder you copy once for each new program.
Terminal
The panel at the bottom where your output appears.

'F' → Fullscreen

divider

Build

If the workspace is not open yet, follow Setting Up Your Workspace first — it takes about five minutes and everything below assumes it is done.

Task 1: Run Something You Did Not Write

In VS Code, right-click the template-console folder, choose Copy, then Paste. Rename the copy to 1-01-hello.

Open main.lua inside it. This is already there:

main.lua
io.write("What is your name? ")
local name = io.read()
print("Nice to meet you " .. name)

Press Run. The terminal panel asks for your name and waits. Type it and press Enter:

Terminal
What is your name? Sam [Enter]
Nice to meet you Sam

Do not edit conf.lua — the other file in the folder. It is what makes the Run button work. Everything you write goes in main.lua.

Task 2: Make It Say Something Else

Add one line at the bottom and run it again:

main.lua
io.write("What is your name? ")
local name = io.read()
print("Nice to meet you " .. name)
print("Welcome to AP Computer Science Principles.")
Terminal
What is your name? Sam [Enter]
Nice to meet you Sam
Welcome to AP Computer Science Principles.

Now change the wording of both messages to something of your own. Run it after every change — that habit is worth more than anything else you learn today.

Task 3: Three True Things

Make another copy of template-console, rename it 1-01-about-me, and delete everything in its main.lua.

Write three print lines that say three true things about you. Keep them appropriate for class:

main.lua
print("I am in tenth grade.")
print("I have never written a program before.")
print("I would rather build a game than a website.")
Terminal
I am in tenth grade.
I have never written a program before.
I would rather build a game than a website.

Challenge (Optional): Break It on Purpose

Delete one quotation mark and run it:

main.lua
print("I am in tenth grade.)
Terminal
Error: Syntax error: main.lua:1: unfinished string near '"I am in tenth grade.)'

Nothing printed at all. The program never started, because it was not valid Lua. Copy the message onto your sheet, then put the quote back.

You will see a lot of these. An error message that names a line number is doing you a favor.

divider

Checkpoint

  • 1-01-hello runs, asks your name, and greets you
  • Both of its messages are in your own words
  • 1-01-about-me prints three true things
  • Both folders are copies of the template, not edits of it
divider

Reflection

Answer the following questions before submitting your work.

  1. The Create Task is a program you build in Quarter 3 and then write about, from memory, on exam day. Explain why that makes submitting someone else's code a bad deal for you specifically.
  2. You copied a template instead of editing it. Give one reason that is better than editing the original.
  3. Something on your screen today did not do what you expected — a typo, an error, a message that did not appear. Describe what happened and what you did about it.
divider

Submit

Submit the required files to the appropriate dropbox.

Activity Complete