{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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 square6 E-mail: [email protected] square6 Website: www.cs.washington.edu/homes/bensonl/ud 3 Course meeting times square6 June 23 – August 8 boxshadowdwn (excluding June 30 - July 11) square6 Lecture: boxshadowdwn Mon – Fri (8h30 – 10h00) square6 Lab: boxshadowdwn 06ECE: Mon – Fri (15h00 – 16h30) boxshadowdwn 07ECE: Mon – Fri (10h00 – 11h30) 4 Textbook square6 “Beginning C: From Novice to Professional” Ivan Horton square6 Textbook has some small errors boxshadowdwn If something does not seem right and you are not sure, ask! square6 We won’t necessarily go in the same order as the book. 5 Grade breakdown square6 40% homework square6 25% midterm square6 35% final 6 How to do well in this course square6 Keep up with the assignments boxshadowdwn The course material is cumulative square6 If you don’t understand something, ask questions (especially “WHY?”). boxshadowdwn There’s no such thing as a dumb question. boxshadowdwn 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 Document Right Arrow Icon
2 7 Basic C programs Readings: Chapter 1, pg. 1 - 20 8 Algorithmic thinking square6 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! square6 C is a programming language . #include <stdio.h> int main() { printf("Hello world!"); } square6 Save the program in a file named name .c where you replace name with any filename you want. square6 What does this code output (print to the user) when you run (execute) it?
Background image of page 2
3 13 Running a program square6 Before you run a program, you must compile and link it. square6 compiler: Translates a computer program written in one language (i.e., C) to another language (i.e., object code) square6 linker: Combines object files and other required files into an executable square6 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 square6 Editing square6 Compiling square6 Linking square6 Executing 15 Program execution square6 The output is printed to the console . square6 Some editors pop up the console as another window. 16 Writing your own C programs #include <stdio.h> int main() { <statement>; <statement>; <statement>; } square6 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 square6 syntax: The set of legal structures and commands that can be used. square6 Examples: boxshadowdwn Every basic statement ends with a semi-colon.
Background image of page 3

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

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

{[ snackBarMessage ]}