0% found this document useful (0 votes)
267 views57 pages

Computer Science Harvard Powerpoint

The document provides an overview of week 1 topics for an introductory computer science course including Harvard's Mark I computer, software bugs, problem set 0, Boolean expressions, conditions, loops, functions, variables, data types, compiling and running programs, standard libraries, and using Linux commands.

Uploaded by

Andy Tran
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
267 views57 pages

Computer Science Harvard Powerpoint

The document provides an overview of week 1 topics for an introductory computer science course including Harvard's Mark I computer, software bugs, problem set 0, Boolean expressions, conditions, loops, functions, variables, data types, compiling and running programs, standard libraries, and using Linux commands.

Uploaded by

Andy Tran
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

week 1

http://en.wikipedia.org/wiki/Harvard_Mark_I

http://en.wikipedia.org/wiki/Software_bug

CS50 Lunch
cs50.net/rsvp

cs50.net/lectures

videos
slides
examples
walkthroughs
scribe notes

sectioning
starts Wed

supersections

[email protected]

problem set 0

office hours
cs50.net/ohs

CS50 Discuss
cs50.net/discuss

statements

Boolean expressions

conditions

loops

functions

source code

source code

#include <stdio.h>
int main(void)
{
printf("hello, world\n");
}

source code
compiler
object code

source code
compiler
object code

source code
compiler
object code

10000011
00000000
10010000
00001011
00000000
00000000
00000000
01110000
00000000
00000000
00000000
11111111
10010000
00101110
10110000
10110000
10100000
10110000
00000000
00000000
00000000

00000001
01000000
00000000
00000001
00100000
00100000
00000000
00010000
00000000
00000000
00100000
11111111
10000000
01100100
00000100
00000100
00000001
00000100
00000000
00000000
00000000

00010001
00000000
00000000
00001011
00000000
00000000
00000000
00000000
00000000
00000000
00000000
11111111
00000000
01111001
00000000
00000000
00000000
00000000
00000000
00000000
00000000

00000000 00111101
00000000 00000000
00000000 01010000
00000011 00001010
00000000 00000000
00000000 00000000
00000000 00000000
00100000 00000001
00100000 00000001
01000000 00000001
01000000 00000001
11111111 11111111
01000000 00000001
01101110 01100001
00100000 00000001
00100000 00000001
00000000 00000000
00000000 00000000
00000000 00000000
00000000 00000000
00000000 00000000
...

11111100
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
11111111
00000000
01101101
00000000
00000000
00000000
00000000
00000000
00000000
00100000

01110100
00000000
00000111
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
11111111
00000000
01101001
00000000
00000000
00000000
00000000
00000000
00000000
00000000

00111101
00000000
00110000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
11111111
00000000
01100011
00000000
00000000
00000000
00000000
00000000
00000000
00000000

int main(void)
{
printf("hello, world\n");
}

statements

statements

printf("hello, world\n");

loops

loops

while (true)
{
printf("hello, world\n");
}

loops

loops

for (int i = 0; i < 10; i++)


{
printf("hello, world!\n");
}

variables

variables
int counter = 0;
while (true)
{
printf("%d\n", counter);
counter++;
}

Boolean expressions

Boolean expressions

(x < y)
((x < y) && (y < z))

conditions
if (x < y)
{
printf("x is less than y\n");
}
else if (x > y)
{
printf("x is greater than y\n");
}
else
{
printf("x is equal to y\n");
}

#include <stdio.h>
int main(void)
{
printf("hello, world!");
}

how to write a program


gedit

how to compile a program


make hello

how to run a program


./hello

Linux commands
ls
mkdir
cd
rm
rmdir
...

how to compile a program


clang -o hello hello.c

how to run a program


./hello

functions
main

Standard Library
stdio.h
printf
...

CS50 Library
cs50.h
GetChar
GetDouble
GetFloat
GetInt
GetLongLong
GetString

types
char double float int long long ...

to be continued...

You might also like