Contact Information:Mr. Brennan
E-mail:JBrennan@isbos.org
Cell:(617) 872-2932
Skype ID:hwmath.jim

Trimester I Introduction to Computer Science

Agendas

DateTopics/Activities
Tuesday
October 27
    Starter
  • Announcements:
    • Quiz 1 : BASIC commands - returned, discuss grading
    • Use of google drive to turn in files
    • Office Hours: Tuesday before school and Thursday in student lounge or library at 1:00.
    • This will be the last day using class time for Labs 1-5. Additional time can be arranged.
    • other questions?
  • Quiz : Commands from the command prompt
    Main Activity
  • Turn in all files to the google drive
  • Complete BASIC Labs 1 through 5
  • Optional Labs 6 and 7 for students who have turned in all other Labs
    Summary:
  • The following program creates an array of 100 random numbers between 0 and 1000.
    100 DIM R(100)
    200 for i =1 to 100
    220      R(i) = (RND(1)*1000) mod 1000
    240      REM print "R("i") = ", R(i)
    260      next i

      Can you modify the program to find (and print out) the following:
    • The lowest number generated
    • The highes number generated
    • The list of numbers in ascending order (lowest to highest)
    • The list of numbers in descending order (highest to lowest)
    • The average of all of the numbers
Fall
Vacation
    Optional Extension Activities
  • Lab 6
    • Open the directions for Lab-6 and follow all of the directions.

  • Lab 7
      Open the directions for Lab-7 and follow all of the directions.
      Deliverable: Submit any programs you create, for extra credit, by copying them to the google drive by the end of the day Monday October 26

Friday
October 16
    Starter
  • Quick review of the resources available on this web site, the list of activities we've done in class, some notes on the activities, and the list of concepts separated by topic.
  • Quick list of optional labs (Lab 6 and Lab 7) that students can try out over the break.

    Main Activity
  • Submit a copy of your file: LearningBasic.doc onto the google drive for grading. (Due today)

  • Lab 5 While Loops and File Processing
      Lab 5 Part I
    • Open the directions for Lab-5 Part I and follow all of the directions.
      File: echo.bas
      Deliverable: e-mail copyme.bas and copyme.out to JBrennan@isbos.org

      Lab 5 Part II
    • Open the directions for Lab-5 Part II and follow all of the directions.
      File: testcopy.dat
      Deliverable: e-mail copyfile.bas to JBrennan@isbos.org

      Lab 5 Part III
    • Open the directions for Lab-5 Part III and follow all of the directions.
      Deliverable: findstr.bas
    Summary:
  • File processing notes
    The lab uses #1 for the input channel and #2 for the output channel. You will get an error trying to read from the output channel or write to the input channel. Review the PRINT and LINE INPUT statements to make sure that they are using the correct channel - when they are using channels.
    Homework:
  • See optional Labs 6 and 7
Thursday
October 15
    Starter
  • Share your ideas about Google Classroom and the School Portal
    Main Activity
  • Be sure to copy to the google drive each of the files for Lab 4:
    • Part I: ForLoop.bas
    • Part II: DaysAway.bas
    • Part III: Primes.bas
  • Submit a copy of your file: LearningBasic.doc onto the google drive for grading. (Due Friday)

  • Lab 5 While Loops and File Processing
      Lab 5 Part I
    • Open the directions for Lab-5 Part I and follow all of the directions.
      File: echo.bas
      Deliverable: e-mail copyme.bas and copyme.out to JBrennan@isbos.org

      Lab 5 Part II
    • Open the directions for Lab-5 Part II and follow all of the directions.
      File: testcopy.dat
      Deliverable: e-mail copyfile.bas to JBrennan@isbos.org

      Lab 5 Part III
    • Open the directions for Lab-5 Part III and follow all of the directions.
      Deliverable: findstr.bas
    Summary:
  • File processing notes
    Homework:
  • Download the Operating System Note file OS-Commands.doc. This is a MS Word file that contains a list of basic skills that you are using to navigate in the Command Prompt Window. These skills will be applicable to other operating systems. Fill out this "How To" form with notes/directions and examples from your labs. Keep this document electronically.
Tuesday
October 13
    Starter
  • Quiz: BASIC command
    Main Activity
  • Complete All Part of Lab 4: and e-mail all required programs

  • Lab 5 While Loops and File Processing
      Lab 5 Part I
    • Open the directions for Lab-5 Part I and follow all of the directions.
      File: echo.bas
      Deliverable: e-mail copyme.bas and copyme.out to JBrennan@isbos.org

      Lab 5 Part II
    • Open the directions for Lab-5 Part II and follow all of the directions.
      File: testcopy.dat
      Deliverable: e-mail copyfile.bas to JBrennan@isbos.org

      Lab 5 Part III
    • Open the directions for Lab-5 Part III and follow all of the directions.
      Deliverable: findstr.bas
    Summary:
  • File processing notes
Friday
October 9

Thursday
October 8

    Starter Friday: Openning a Command Prompt Window
  • Operating System Topics
    • Special file names and file types
    • Mapping directories
    • Redirecting input
    • Redirecting Ouput
    • piping
    • For reference Quad1v3.bas
    • Batch Files
    Main Activity
  • Complete Lab 4 Part I The FOR statement and PRINT USING
    File: Trace-2.basThis was updated on Tuesday afternoon so the line numbers match the lab instructions.
    When you are finished. e-mail your program ForLoop.bas to JBrennan@isbos.org

  • Complete Lab 4 Part II Using Arrays
    File: DaysAway.bas
    When you are finished. e-mail your program DaysAway.bas to JBrennan@isbos.org

  • Complete Lab 4 Part III Using Arrays and FOR Loops
    File: Trace-3.bas
    When you are finished. e-mail your program Primes.bas to JBrennan@isbos.org

  • Download the BASIC Programming Note file LearningBasic.doc. This is a MS Word file that contains a list of basic skills that you are learning about programming in general, and BASIC programming specifically. Fill out this "How To" form with notes/directions and examples from your BASIC program. Keep this document electronically - it allows you to copy-cut-paste program code.

    These programming skills are the basic skills needed for learning (almost) any programming language. Learning these skills is a recipe for how to learn additional programming languages. You will submit this next Friday for a grade.

    Summary:
  • Summary of Programming Terms
  • Summary of operating systems commands
  • Creating a Batch File
  • If you are not able to log into the network because your userid has expired, be sure to contact the IT department.
Tuesday
October 6
    Starter
  • Trace the purpose of the variables in program Trace-3.bas.
    Complete the Trace-3 Variables handout.
  • Homework check - completing the QUAD1 program on the TI84
    Main Activity
  • What are variables really?
  • Presentation: Variable Types and type conversion
  • Presentation: Introduction to Arrays - Using Arrays (of numbers, of strings)
  • Presentation: Tracing a Program with a loop: TraceProgram-Trace-2.pdf
  • Introduction to the FOR Statement

  • Lab 4 Part I The FOR statement and PRINT USING
    Trace-2.basThis was updated on Tuesday afternoon so the line numbers match the lab instructions.

    Summary:
  • Basic Command Summary and where we go from here.
Friday
October 2
    Starter: Integer Arithmetic
    Agenda
    Summary:
  • What is a program?
  • What does it mean to trace a program?
    Homework: Due Tuesday
    Complete the QUAD1 program on the TI-84 calculator to find the roots of a quadratic equation. The QUAD1 program for the graphing calculator can be completed incrementally - step by steps instructions can be found below in the Content Covered section.
      Program requirements:
    1. Prompt the user for a,b,c
    2. Echo the values back to the user
    3. Have error checking
      if A = 0 then
            send the user an error message
          stop the program
    4. Calculate the value of D = B2-4AC
    5. If D < 0 then
            tell the user there are no real solutions
           stop the program
    6. if D = 0
           tell the user why there will be only one real solution
    7. calculate E, F (as needed) display values E,F (as needed)
  • On Tuesday we will write a second program that will loop and call QUAD1 until the user indicates that they don't want to run it any more.

Thursday
October 1
    Starter: Summary of Commands issued on the Command Line
    Main Activity - Lab 3: Conditional Programming in BASIC
  • Open Lab-3.pdf.
  • Follow the directions (or follow allong with the front of the room)
  • File QuadLab3.bas
    Summary:
  • New commands for OS
  • New BASIC commands and program structures
  • Programming Assignments
  • Office Hours
Tuesday
September 29
    Starter: Identify Components of Windows Explorer
    Summary: What is a program?
  • Where does input come from?
  • Where does output go?
  • Today we saw how to deal with several unexpected events:
    • The network was not available when everyone was trying to log in, so we were not able to start right off using the laptops. Not a big deal, we talked about the elements found on a Windows Explorer screen shot and talked about drives and directories.
    • The gwbasic program would not run on the laptops (or the classroom desktop) because it was not compiled to run an a 64-bit computer. We'll talk more about that in the weeks ahead. It took a little time to adjust to the blassic BASIC interpreter and the lab directions were not set up for the blassic interpreter.
    • The lab will be redesigned knowing that :
      • The laptops have access to a command prompt which will be very benefitial to our discussions about operating systems.
      • The blassic BASIC interpreter does work and all of the objectives for using BASIC will be met using it instead of gwbasic.
Friday
September 25
    Starters:
  • Course introduction
  • Summary of what we did yesterday
  • Specifics Bob How old is a person...
    Main Activities
  • Continue with QUAD1 program for the graphing calculator
    See versions below.
      References:
    • Notes from yesterday, quadratic equation, and some calculator screen shots.
    • Command Reference for Programming the TI84/85

        Command Notes
      • The Input command can prompt the user for one variable, such as
        Input A
        but it will only prompt the user with a ?
        so often the Input command will be used with a string that will act as a prompt:
        Input "Enter A:",A
      • The Prompt command can prompt the user for one variable or more , variables, but will prompt the user for them one at a time
        Prompt A, B, C
      • The Disp command Dispplays output to the user. A text string will be left justified on the screen and numbers will be right justified.

        Test Data
      • x2 + 3x - 4 = 0
        A = 1, B = 3, C = -4
        Solutions: x = -4, x = 1
      • 2x2 - 4x - 3 = 0
        A = 2, B = -4, C = -3
        Solutions: x = -0.58113883, x = 2.5811388
      • What happens when A=1, B=1, C=5 ?
      • What happens when A=0, B=3, C=2 ?
Thursday
September 24
    Starter: Posted questions
    Main Activity
  • Defining the steps
  • Phenomenon
  • Using variables / TI84
  • Programming TI84
    Summary: What is a program?

Content Covered
TI 84 Assignments

These programs should be working in you calculator by the end of the day on Tuesday October 6.

    Programming the TI83/TI84
  • The QUAD1 program for the graphing calculator can be completed incrementally - add some functionality and complete testing for each version.
  • Versions:
    1. prompt the user for a,b,c
      echo the values back to the user
      Step-by-Step Directions Lab 1: QUAD1 Version 1
    2. prompt the user for a,b,c
      echo the values back to the user
      calculate d, e, f
      display values e,f
      Step-by-Step Directions Lab 1: QUAD1 Version 2
    3. add error checking
      if A = 0 then
            send the user an error message
          stop the program
      Step-by-Step Directions Lab 1: QUAD1 Version 3
    4. If D < 0 then
            tell the user there are no real solutions
           stop the program
    5. if D = 0
           tell the user why there will be only one real solution
    6. write a second program that will loop and call QUAD1 until the user indicates that they don't want to run it any more.

Summary and Reminders
    Summary
  • A Textbook will not be required. Reading assignments will use online resources and handouts as needed.
  • The Key Concepts section below will be updated as we cover topics. These are the terms that you should know; The terms in the objectives section are topics you will know.

    Reminders
  • Supplies: A calculator and iPad everyday will be helpful
  • For the time being, we will use the school's laptops for all computer programming activities.
  • Homework
  • Quiz:
  • Office Hours:Still need to be determined
Unit-1 Student Handouts/Resources
 


Introduction to Programming

Introduction to Programming: Key Concepts
Concept:1Program
A program is a sequence of one or more commands that tell a computer what to do.
Concept:2 Program Components
Three primary components of a program : input, processing, output.
These are the main components of any system.
The fourth component is a user.
    for the Calculator program:
  • Input will come from the user
  • Processing will be perfromed on values supplied by the user
  • Output will be to the user - and will be the results of the calculations performed on the user's input.
Concept:3.Flow Chart
Concept:4.Pseudo-code
Concept:5.BASIC Programming Statements
  • REM: Remark - used as a comment to document a program
  • INPUT: Receive input from the user
  • PRINT: Sends output to the user
  • IF <condition> THEN Line#: Checks to see if Assignment statements: Assign a variable a value: var = value
  • SQR(x): A builtin function to find the square root of x.
  • MOD: Used to find the remainder of integer division: 7 MOD 4 would be 3, becuase 7 divided by 4 is 1 with a remainder of 3.
  • GOTO Line#:An unconditional program branch to the specied Line#
  • LINE#: All BASIC programs that we have used have line numbers; the program are processed sequentially by Line#, if a program has lines that are not in order (or have duplicates) then the output might not be as expected.
  • PRINT USING : The USING clause provides formating specifications to the PRINT command. See Lab-4.
  • FOR : Replace the use of GOTO statements with a more structured way to repeat a group of statements, in a controlled way.
  • DIM : Declares the DIMensions of an array, when the default array size of 10 is not adequate.
  • VAL : Used to covert a variable from one data type to another. For example. if you had a string that represented a number such as A$="100" and you wanted to add 15 to it, you would need to convert the string to a number using VAL:
    B = VAL(A$) + 15
Concept:6.More BASIC Statements
These statements are covered in Labs 5 and 6
  • LINE INPUT : reads in an entire line, not just up to the first comma
  • WHILE..WEND : defines a while loop to repeat a group of lines as long as some condition is true
  • INSTR : Searchs a string for the existance of another string.
  • OPEN : Opens a file for read, writing, or updating
  • CLOSE : Closes a file
  • EOF : A function to determine whether the End Of a File has been reached. good for getting out of input-processing loops while reading files.
  • LEFT$ and MID$ : Functions that will return parts of string
  • str1$ + str2$ : The "+" operation with strings will concatenate one string with another.
      Example:
      A$ = "Firstname"
      B$ = "LastName"
      C$ = A$ + " - " + B$
      the contents of variable C$ is now "Firstname - LastName"
  • INPUT #1, A$ : Reads from the file opened AS #1
  • PRINT #3, A$ : writes to the file opened AS #3

Activities
Programming the TI84 The Quadratic Formula
  • Creating a program in the TI84 calculator
  • Editing a program
  • Executing a program
  • Using [STO] to save values in variables
  • Getting input from the user
  • Sending output to the user
  • Conditional programming - testing for special cases uses the IF statement
Lab 1 Programming the TI84
The Quadratic Formula

  • Version 1
    Prompt the user for value, echo values back to the user.
  • Version 2
    Add calculations of the roots for quadratic equation; display output to the user
  • Version 3
    Add error checking and conditional programming
Lab 2Introduction to BASIC Programming
  • Introduction to the Command Prompt
  • Commands for the command prompt
  • Running the basic interpreter (the lab was written for GWBASIC but blassic was used instead)
Lab 3BASIC Programming
  • Part 0: Review of operating system command and some BASIC programming
  • Part 1: Set up the Computing Environment
  • Part 2: Running and Editing programs from within BASIC
  • Part 3: Adding conditional processing with the IF statement
  • Part 4: Repeating blocks of statements [GOTO Loops]

Lab 4BASIC Programming
Lab 5BASIC Programming
  • Lab 5 Part I
    • The WHILE..WEND loop
    • LINE INPUT
    • OPEN "" FOR OUTPUT AS #
    • PRINT #, output-to-write
  • Lab 5 Part II
    • OPEN file AS $
    • LINE INPUT #
    • EOF
    • Close #
  • Lab 5 Part III
    • Command Line Parameters
    • The INSTR command
Lab 6BASIC Programming Extension (Optional)
Lab 7BASIC Programming Extension (Optional)
Tracing Programs Determining program functions
  • Identify variables and how the are used
  • Tracing programs one statement at a time
  • Tracing the output of a program to help identify the program's purpose
BASIC Arithmetic Integer operations
  • Addition and subtraction
  • Multiplication and integer division
  • The mod function (remainder)
Summarizing BASIC Commands Document how BASIC commands work
    provide program examples.

File List

File List


Introduction to Operating Systems

Introduction to Operating Systems: Key Concepts
Concept:1.Command Line Commands
    Commands are not case-sensitive
  • Echo: outputs a string of text to the console
  • CD: Changes the working directory
  • D:: Changes the working directory to drive D:
  • dir: list the files that are in a directory
  • mkdir directory: makes a new directory
  • PROMPT : Can change the system prompt. By default the prompt is the current working directory followed by the greater than sign.
  • PATH: sets the list of the directories that the operating system will search when the user issues a command or the name of a program to execute.
  • TYPE: will read a text file and display the contents to the user - the display could be garbled if the file specified is not a text file.
  • COPY: copy file1 file2 will make a copy of file1 with the new name file2
    copy dir1\file1 : issued with only one file specified will copy file1 from directory dir1 into the current working directory.
  • CLS: Clears the screen, bringing the cursor to the top of the screen.
Concept:2.Special File Names/Types
Some file extensions are used by the operating system to idenitfy programs that can be executed. The extensions commonly used are .bat, .com, and .exe. When entering a command (such as sort) the operating system will seach all of the directories in your PATH for the file to be executed (sort.bat, sort.com, sort.exe).
Concept:3.Batch Programs (scripts)
A batch file, or batch program, contains a list of commands to be executed. Batch files usuall end with the .bat extension; there is support for loops and conditional processing in batch files and they can be complex.
Concept:4.Redirecting Program Input
When a program is run, the program can receive its input from a file rather than from the keyboard (or console) using the sysbol < Example: the program echo.bas reads input from the keyboard and echos the data back to the screen. : blassic echo.bas. Any text file could be used as input rather than the console by using:
blassic echo.bas < daysAway.bas will send the contents of the daysAway.bas program to the screen as if the user had typed it in.
Concept:5.Redirecting Program Output
Output from a command can be redirected to a file - meaning that output from the command will not be displayed on the screen it will be sent to a file. If the output file does not exist it will be created; if the output file does exist, it will be overwritten.
Example: dir > toc.txt this creates a text file containing the directory listing of the current directory.

Output from a command can be appended (added to the end) to an existing file using >>h;
Example: dir >> myfiles.txt
If the file specified does not exist it will be created, if the file myfiles.txt does exist the contents of the current directory will be added to the end of the file.

Concept:6.Piping
Piping refers to using the output from one command as input to another, the commands are connected using the symbol |
Example: the command dir /p will show you the contents of the current directory, one page at a time. The command dir | more will show you the contents of the current directory - also one page at a time - but also provides you with the additional functions of the more command, such as just seeing the next line (instead of the next full screen).

Activities
Pres-CommandLine-2.pdf Interactive command line presentation covering the following topics:
  • Special files (CON)
  • Batch Files
  • Mapping drives and directories
  • Redirecting command input
  • Redirecting command output
  • Piping
OS-Commands.doc Description
Download the Operating System Note file OS-Commands.doc. This is a MS Word file that contains a list of basic skills that you are using to navigate in the Command Prompt Window. These skills will be applicable to other operating systems. Fill out this "How To" form with notes/directions and examples from your labs. Keep this document electronically.

File List

File List


How Computers Operate

Introduction to Personal Computing: Key Concepts
Concept:1.Boolean Operations
  • AND
  • OR
  • NOT
  • Exclusive Or
  • NAND
  • NOR

Concept:2.Logic Gates

Review Simple Logic Gates
Concept:3.Booean Algebra
Review the rules of Boolean Algebra
Concept:4.Representing Booean Expressions
  • Truth Tables : Represent the behavior of logic gates. They list the outcome of all possible input combinations of boolean variables.
  • Review Karnaugh Maps
  • Review Logic Circuits
Concept:5. Review the Machine Cycle The Fetch-Execute Cycle
Computer Internals
ComputerA machine that processes data under the control of a stored program
Operating System A set of system software routines that interface between an application program and the hardware
A Program A series of instructions that guide a computer through a process
The processor Manipulates the data stored in memory under the control of a program stored in the memory
Optional Video Review Computer Organization - the Central processor 13 minute video.
Arithmetic and Logic Unit Executes the instruction in the instruction register
OS User Interface Functions that provide support for the user and application programs to communicate with the OS
OS File Management Functions that provide support to manipulate files by names
OS Device Management Functions that provide support for peripheral devices to communicate with the OS
OS Communication Services The operating system functions that support communications between computers
OS Memory Management The operating system functions that manage memory space
OS Process Management The operating system functions that manages the processor's time
Cache An area of high-speed memory that sits between the processor and primary memory; memory that serves as a staging area for the processor;
A buffer Temporary memory or storage used to adjust for the speed differences between adjacent devices.
Word A group of bytes (usually 4 or 8)

Activities
P88 ProgrammingActivities
    For homework, download the P88.jar file and complete one of the following program assignments. Submit pseudo-code, the assembly language code, and the machine code file .as file. Don't skip steps by trying to code in machine code before writing out what you are trying to do.

    Programming Choices:

  • Write a program that will ouput the numbers from 1 to 10.
  • Write a program that will prompt the user for a number, and then output a list of numbers from 1 to the number specified by the user.
  • Write a program that will prompt the user for a starting number, and an ending number, then output the sum of all of the numbers from the starting number to the ending number.
  • Write a program that prompts the user for 10 numbers, and store them in memory locations 40 to 49.
P88 Project Homework Assignment
    Complete a P88 program that will
  • prompt the user for up to 10 positive numbers
  • stores them in memory locations that you may determine (was 40 to 49, but that may not be the best place).
  • allow the user to enter a value less or equal to 0 to signal your program that they are finished entering numbers.
  • sort the list of numbers from high to low
  • send the list of numbers to the output in decending order
  • Upload a file name sort10.as into your google drive folder on the class web site for grading.
  • DUE: Tuesday before class
Logic Operations Logic circuits and Truth tables
Number SystemsRepresent numbers in Decimal, Binary, Hexadecimal, and Octal
Interpret Logic Circuits Class handouts

File List

File List


Introduction to Computer Science: Objectives

  

Topic 1: System fundamentals

Objectives:

1.1 Systems in Organizations

Planning and system installation
1.1.7Suggest various types of testing.
User Focus
1.1.8Describe the importance of user documentation.
1.1.9Evaluate different methods of providing user documentation.
1.1.10Evaluate different methods of delivering user training.
Software Deployment
1.1.14Describe strategies for managing releases and updates.

1.2 System Design Basics

Components of a Computer System
1.2.1Define the terms: hardware, software, peripheral, network, human resources.

Topic 2: Computer organization

Objectives:

2.1 Computer Organization

2.1.7Outline the use of a range of application software.

Topic 4: Computational thinking, problem-solving and programming

Objectives:

4.1 General Principles

Thinking Procedureally
4.1.1Identify the procedure appropriate to solving a problem.
4.1.2Evaluate whether the order in which activities are undertaken will result in the required outcome.
Thinking Logically
4.1.4Identify when decision-making is required in a specified situation.
Thinking Ahead
4.1.9Identify the inputs and outputs required in a solution.
4.1.13Identify exceptions that need to be considered in a specified problem solution.

4.2 Connecting Computational Thinking and Program Design

4.2.4Analyse an algorithm presented as a flow chart.
4.2.5Analyse an algorithm presented as pseudocode.
4.2.6Construct pseudocode to represent an algorithm.

4.3 Introduction to Programming

Nature of Programming Languages
4.3.1State the fundamental operations of a computer.
4.3.2Distinguish between fundamental and compound operations of a computer.
4.3.3Explain the essential features of a computer language.
4.3.4Explain the need for higher level languages.
4.3.5Outline the need for a translation process from a higher level language to machine executable code.
Use of Programming Languages
4.3.6Define the terms: variable, constant, operator, object.
4.3.7Define the operators =, ., <, <=, >, >=, mod, div.
4.3.8Analyse the use of variables, constants and operators in algorithms.
4.3.9Construct algorithms using loops, branching.


File List

File List