TA Office hours - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

TA Office hours

Description:

TA Office hours. See web page. Reminders ... Course web site ... A pastime similar to banging one's head against the brick wall with less productive results. ... – PowerPoint PPT presentation

Number of Views:37
Avg rating:3.0/5.0
Slides: 31
Provided by: pauldp
Category:
Tags: hours | office | pastime

less

Transcript and Presenter's Notes

Title: TA Office hours


1
TA Office hours
  • See web page

2
Reminders
  • Course web site (all course information)
  • http//classes.engr.oregonstate.edu/eecs/
  • Then select CS151-001
  • Black Board
  • quizzes, email, announcements
  • http//my.oregonstate.edu/
  • engr account
  • Programming assignments will be posted starting
    on Monday
  • Programs are handed in at https//engr.orst.edu/

3
Blackboard ONID
  • You need to sign up for an ONID (OSU Network ID)
    account at
  • http//www.onid.orst.edu/
  • Then login to Blackboard at
  • http//my.oregonstate.edu/
  • Take Quiz 1 starting Monday on Blackboard.
  • You may take the quiz as often as you like. It
    is a learning tool. You must get a score of at
    least 8 for the quiz to count.

4
Program Assignments
  • Find them at
  • http//classes.engr.oregonstate.edu/eece/cs151-001
  • programs due Friday by 1159 pm. ...

5
Programming at Home
  • Only if you know what you are doing .
  • Limited help from me or TAs.
  • We have limited supply of version 7 compilers for
    those with demonstrated need.
  • You'll need to install a cs151 template.
  • Best to test and submit from lab (CodeWarrior
    version 8).

6
What
  • Introduction to programming
  • Program
  • A magical spell cast over a computer allowing it
    to turn one's input into error messages.
  • Programming
  • A pastime similar to banging one's head against
    the brick wall with less productive results.

7
How
  • Lecture (important)
  • Reading (very important)
  • Quizzes (very important)
  • Programs (absolutely indispensible)
  • Exams (to test what you've learned) ...

8
How Learn by Doing!
  • Can only learn by doing.
  • Study understand applications in book.
  • Suggest running at least one application from
    each chapter under CodeWarrior.
  • Understand examples from class.

9
Why C Language?
  • Efficient language (fast and compact).
  • Extremely flexible.
  • Good primer for learning C, Java, JavaScript,
    C, Perl, PHP, etc.
  • real programming

10
CodeWarrior - The Main Tool
  • IDE - Integrated Development Environment
  • Editor (for writing programs)
  • Compiler (for translating into executables)
  • Organizer (for organizing projects)
  • Debugger (for finding and fixing bugs)
  • Complex tool.
  • Learn it early - pgm1 and exercises in book...

11
Computers Programs
Computer
32 address wires
Memory
Computer Processing Unit (cpu)
1 2 3 5 6 7 8 9
32 data wires
instructions data
PC
  • Connect to Program Counter address
  • Load (fetch) instruction
  • Execute instruction
  • Increment Program Counter

Program
12
All instructions and data are just on/off
switches inside the computer.
  • Sometimes represented for humans as zeros and
    ones 0 off, 1 on
  • Example 01011001 represents the number 89 or
    instruction number 89 or character Y
    depending on how it is used
  • Nobody wants to write programs using only zeros
    and ones.
  • so programming languages and compilers were
    invented

13
Languages
assembly language
machine language
address
000000010110 PUSH SS 000101010100 PUSH
SP 000201010010 PUSH DX 000301000001 INC
CX 00040000000000000111 ADD BX,AL
Address Location of data in memory Machine
Lang Numbers assigned to instructions Assembly
Lang Symbolic (text) representation
of instructions.
14
High Level Languages (HLL)
  • Translators
  • Assembler (Assembly Lang -gt Machine Lang)
  • Compiler/Linker (HLL -gt Machine Lang)
  • Interpreter (Executes HLL directly)
  • HLLs
  • ADA, BASIC, C, C, COBOL, EIFFEL,
  • FORTRAN, JAVA, LISP, PASCAL, PERL
  • PHP, PROLOG, SCHEME, Tcl/Tk ...

15
Programming in HLL
  • Write program text using an editor.
  • Translate program into machine language using a
    compiler (machine specific).
  • Connect the machine code to built-in functions
    (e.g., input/output) using a linker.
  • Load the program into memory.
  • Execute.

16
Compiling Process
  • Compile - Translate from source text file into
    object format. Addresses of instructions and
    data not yet fixed.
  • Link - Combine multiple object files in such a
    way to make a complete executable program (i.e. a
    file with .exe suffix which will run when
    double-clicked). ...

17
Create compile link load - execute
Libraries
Idea
Linker
Executable code
Text editor
Source code
Compiler
Operating system loads executable program into
the computers memory, and starts execution
Object code
18
Using C under CodeWarrior
Computer
19
Using C under CodeWarrior
Computer
Windows (operating system)
20
Using C under CodeWarrior
Computer
Windows (operating system)
CodeWarrior (IDE)
Text Editor
C Compiler
Linker
Other tools
Libraries
21
Programming
  • Programming is an unnatural act.
  • Humans solve problems without knowing how.
  • Computers need step-by-step solution (i.e an
    algorithm).
  • Our task
  • Learn to create algorithms to solve probs
  • Learn the language (for this course, C)

22
A Simple Program Printing
  • Make a program that prints text on the screen.
  • Basic outline of a C program
  • Use a library function, printf().

23
Functions
  • A C program consists of functions.
  • Functions are starting points of execution.
  • Every C program starts with a function called
    'main'
  • Functions can accept input values, perform tasks,
    and possibly return computed values.

24
Function Structure
function name
function input
output type
function body start
int main (void) / C instructions here
/ return 0
C instruction
comment
C "period"
output value
function body end
25
C Function Libraries
  • C comes with many libraries of "ready-made"
    functions
  • Two steps to using them
  • Use a "include" statement
  • Call the function, I.e., write its name in your
    program

26
The Printf() function
  • Need to include the standard i/o library
  • include ltstdio.hgt
  • Need to call the function.
  • printf("Go Beavers")
  • Text inside double quotes called a string.
  • printf() prints strings on the output screen.

27
A simple program - printing
  • include ltstdio.hgt / preprocessor directive /
  • int main (void)
  • printf("Go Beavers") / print some text /
  • return 0

28
Parts of the program
  • Preprocessor
  • include ltstdio.hgt
  • Include the file named stdio.h as part of this
    program.
  • .
  • Comments
  • / print some text /
  • This is a programmers comment an explanation of
    the
  • meaning of this part of the program. It is
    ignored by the
  • compiler.

29
Main Function
  • int main (void)
  • printf("Go Beavers")
  • return 0
  • All programs in the C language start with the
    function
  • main. A function is a named unit of computation
    in the C language. The last statement in main is
    always return 0 for this class.
  • Execution is line by line starting after the
    opening brace, , and ends with the closing
    brace, .

30
Console (Screen) I/O
  • I/O means Input/Output
  • printf("Go Beavers")
  • printf means print formatted to the screen using
    certain formatting rules. Characters inside
    double quotes are called a string constant or
    string literal.
Write a Comment
User Comments (0)
About PowerShow.com