day01 - Contact information WELCOME TO CSE 142! E-mail:

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 1 WELCOME TO CSE 142! instructor: benson limketkai University of Da Nang, Summer 2008 2 Contact information s E-mail: bensonl@cs.washington.edu s Website: www.cs.washington.edu/homes/bensonl/ud 3 Course meeting times s June 23 – August 8 b (excluding June 30 - July 11) s Lecture: b Mon – Fri (8h30 – 10h00) s Lab: b 06ECE: Mon – Fri (15h00 – 16h30) b 07ECE: Mon – Fri (10h00 – 11h30) 4 Textbook s “Beginning C: From Novice to Professional” Ivan Horton s Textbook has some small errors b If something does not seem right and you are not sure, ask! s We won’t necessarily go in the same order as the book. 5 Grade breakdown s 40% homework s 25% midterm s 35% final 6 How to do well in this course s Keep up with the assignments b The course material is cumulative s If you don’t understand something, ask questions (especially “WHY?”). b There’s no such thing as a dumb question. b Computers are neither magical nor mysterious. Everything can be explained!
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 7 Basic C programs Readings: Chapter 1, pg. 1 - 20 8 Algorithmic thinking s Writing programs requires knowing how to think algorithmically al·go·rithm: a step-by-step procedure for solving a problem or accomplishing some end especially by a computer 9 Programming is just like Legos… 12 Your first C program! s C is a programming language . #include <stdio.h> int main() { printf("Hello world!"); } s Save the program in a file named name .c where you replace name with any filename you want. s What does this code output (print to the user) when you run (execute) it?
Background image of page 2
3 13 Running a program s Before you run a program, you must compile and link it. s compiler: Translates a computer program written in one language (i.e., C) to another language (i.e., object code) s linker: Combines object files and other required files into an executable s Building is the process of compiling and linking a program into an executable (hammer icon in Quincy) compile object file ( hello.o ) executable ( hello.exe ) link output execute source code ( hello.c ) edit 14 Stages of programming s Editing s Compiling s Linking s Executing 15 Program execution s The output is printed to the console . s Some editors pop up the console as another window. 16 Writing your own C programs #include <stdio.h> int main() { <statement>; <statement>; <statement>; } s Every executable C program consists of a function called main that contains the statements (commands) to be executed You need this line if you want to use printf 17 Syntax s syntax: The set of legal structures and commands that can be used. s Examples: b Every basic statement ends with a semi-colon. b The contents of a function occur between curly braces. 18 Syntax Errors s syntax error: A problem in the structure of a program. 1 #includ <stdio.h>
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

day01 - Contact information WELCOME TO CSE 142! E-mail:

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online