Subroutines and functions: passing variables
Imagine the "order window" in a restaurant. Say the
server (the "calling" subroutine) passes a ticket with
the order, and the needed plates through the window
to the cook, then after some work the cook (the
WorksheetSyllabusEn 1212016 (38/2=19)
I. Multiple Choice
1. You will write how many major formal papers in Comp.I?
2. The main handbook for rules of grammar and MLA documentation for the course is
A. St. Martins Gu
Errors through computer arithmetic
Adding a small quantity to large quantity causes
errors, small number gets lost due to chopping
A small difference of large numbers
Check an Excel function: mod
Look at examples and what others think about
About job hunting: start now.
The GPA will be important since your resume is short.
Check/clean up driving and credit records.
Check that your on-line presence is what you want it to be,
correct it if possible.
Make absolutely sure that items on your
We will now look at issues introduced by the
limited accuracy and precision of computers and
For example Pi or e can not be represented
exactly, no matter what hardware.
Debugging computer code
You run the program and get an error.
Read the error, perhaps it tells you something.
All variables defined, no typos?
Isolate "bad" code: stepwise eliminate code by placing an apostrophe ' in front
until the program runs.
Open methods to find roots
find next value,
use slope again.
Open: may converge
Closed: (here: bisection)
Simple fixed-point iteration
How: algebra or add x
on both sides of f(x)=0
Homework 1 due see lecture plan
per upload to CHE416 web site
This homework will require a significant time
Remember that there are example programs
posted on the CHE416 web site
Follow the Visual Basic homeworks template
(see Homeworks fold
Recording/running a macro
Developer tab: click Record a Macro
Perform manually what the Macro shall do: for example,
select a range of cells, and fill them with color
Developer Tab: Stop Recording
Press Alt F11
Find your code in the Project window (u
Flowchart exercise: data reduction
Suppose you have 10,000 data points as a
function of time in column 2 of a spreadsheet
(the associated times are in column 1). Develop
a flowchart how to thin out the data points by a
factor of 100 so you ca
What is a computer?
A computer is a device capable of
processing data according to a program
a list of instructions. The data to be
processed may represent many types of
information including numbers, text,
pictures, or sound. (Wikipedia)