This is CS-108
Applications of Information & Communication
Technologies
Applications of ICT
● Welcome!
● Syllabus at LMS: https://lms.nust.edu.pk/portal/
● Lectures slides, Asignments, Quizzes and Labs shall be shared on
LMS.
● Introduce yourself to 2+ classmates near you (that you don't
already know)!
(To break the ice, tell them you're just following this step!)
● Email habeel.ahmad@seecs.edu with questions!
Acknowledgements: We are following the pattern of CS50 @harvard
Lecture Outline
● Computer Science
● Computational Thinking
● Problem Solving: Inputs, Outputs
● Representation: Unary, Binary, Decimal, ASCII, Unicode, RGB
● Abstraction
● Algorithms
● Running Times
● Pseudocode
● Scratch:Functions, Arguments, Return Values; Variables; Boolean
Expressions, Conditionals; Loops; Events; Threads
http://hacks.mit.edu/Hacks/by_year/1991/fire_hydrant/
learn how to program in Python
learn how to program in SQL
learn how to program in JavaScript
learn how to program HTML
learn how to solve problems
learn how to represent numbers
learn how to represent letters
learn how to represent colors
learn how to represent images
learn how to represent videos
learn how to represent audio
learn how to write algorithms
learn how to write code
2/3
of CS-100 students have never taken any CS course before
what ultimately matters in this course is not so much where you end
up relative to your classmates but where
you end up relative to yourself when you began
computer science
problem solving
computational thinking
input → → output
representation
unary
base-1
base-2
binary digit
binary digit
binary digit
bitinary digit
0
1
base-10
decimal
123
1
123
10 1
123
100 10 1
123
100 10 1
123
100 × 1
100 10 1
123
100 × 1 + 10 × 2
100 10 1
123
100 × 1 + 10 × 2 + 1×3
100 10 1
123
100 + 20 + 3
123
100 10 1
###
102 101 100
###
22 21 20
###
4 2 1
###
4 2 1
000
4 2 1
001
4 2 1
010
4 2 1
011
4 2 1
100
4 2 1
101
4 2 1
110
4 2 1
111
4 2 1
000
8 4 2 1
1000
4 2 1
###
byte
00000000
11111111
A
65
01000001
01000001
ASCII
01001000 01001001 00100001
72 73 33
H I
72 73 33
H I !
72 73 33
Unicode
11110000100111111001100010000010
4036991106
U+1F602
🏻🏼🏽🏾🏿
U+1F44D U+1F3FD
U+1F44D U+1F3FD
U+1F491
U+1F469 U+200D U+2764 U+FE0F U+200D U+1F468
U+1F469 U+200D U+2764 U+FE0F U+200D U+1F468
U+1F469 U+200D U+2764 U+FE0F U+200D U+1F468
U+1F469 U+200D U+2764 U+FE0F U+200D U+1F469
U+1F468 U+200D U+2764 U+FE0F U+200D U+1F468
RGB
72 73 33
72 73 33
input → → output
algorithm
code
n
n n/2
n n/2
n n/2
n n/2
log2 n
pseudocode
1 Pick up phone book
2 Open to middle of phone book
3 Look at page
4 If person is on page
5 Call person
6 Else if person is earlier in book
7 Open to middle of left half of book
8 Go back to line 3
9 Else if person is later in book
10 Open to middle of right half of book
11 Go back to line 3
12 Else
13 Quit
1 Pick up phone book
2 Open to middle of phone book
3 Look at page
4 If person is on page
5 Call person
6 Else if person is earlier in book
7 Open to middle of left half of book
8 Go back to line 3
9 Else if person is later in book
10 Open to middle of right half of book
11 Go back to line 3
12 Else
13 Quit
1 Pick up phone book
2 Open to middle of phone book
3 Look at page
4 If person is on page
5 Call person
6 Else if person is earlier in book
7 Open to middle of left half of book
8 Go back to line 3
9 Else if person is later in book
10 Open to middle of right half of book
11 Go back to line 3
12 Else
13 Quit
1 Pick up phone book
2 Open to middle of phone book
3 Look at page
4 If person is on page
5 Call person
6 Else if person is earlier in book
7 Open to middle of left half of book
8 Go back to line 3
9 Else if person is later in book
10 Open to middle of right half of book
11 Go back to line 3
12 Else
13 Quit
1 Pick up phone book
2 Open to middle of phone book
3 Look at page
4 If person is on page
5 Call person
6 Else if person is earlier in book
7 Open to middle of left half of book
8 Go back to line 3
9 Else if person is later in book
10 Open to middle of right half of book
11 Go back to line 3
12 Else
13 Quit
functions
conditionals
Boolean expressions
loops
…
artificial intelligence
If student says hello
Say hello back
If student says hello
Say hello back
Else if student says goodbye
Say goodbye back
If student says hello
Say hello back
Else if student says goodbye
Say goodbye back
Else if student asks how you are
Say you're well
If student says hello
Say hello back
Else if student says goodbye
Say goodbye back
Else if student asks how you are
Say you're well
Else if student asks why 111 in binary is 7 in decimal
…
large language models
Not Reasonable
Using AI-based software other than CS50's own…
Reasonable
Using CS50's own AI-based software…
CS50 Duck
cs50.ai
felt like having a personal tutor …
felt like having a personal tutor… i love how AI bots will
answer questions without ego and without judgment,
felt like having a personal tutor… i love how AI bots will
answer questions without ego and without judgment,
generally entertaining even the stupidest of questions
without treating them like they're stupid.
felt like having a personal tutor… i love how AI bots will
answer questions without ego and without judgment,
generally entertaining even the stupidest of questions
without treating them like they're stupid. it has an, as
one could expect, inhuman level of patience.
Love love loved the duck. We're friends now.
01111111010001010100110001000110000000100000000100000001000000000000000000000000000000000000000000000
00000000000000000000000000000000001000000000011111000000000000000010000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000101000000000001000000000000000000000000000000000000000000000000000000000000000000000
00000000000001000000000000000000000000000000000000000000000001000000000000000000101000000000000000010
00000000101010101001000100010011110010101001000100000111110110000010000001100011100000010001001110001
11010010001011111000000000000000000000000000000000000000000000000000000000000000001011000000000000111
01000000000000000000000000000000000000100100010111111000000000000000000000000000000000000000000000000
000000000000000001001000...01111111010001010100110001000110000000100000000100000001000000000000000000
00000000000000000000000000000000000000000000000000000000000011000000000011111000000000000000010000000
00000000000000000110000000000111100000000000000000000000000000000000000000000000001000000000000000000
00000000000000000000000000000000000000000000001010000011001000000000000000000000000000000000000000000
00000000000000000000000000000000000000001000000000000000011100000000000000001110000000001000000000000
00000111000000000000011001000000000000000100000000000000000000000000000101000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101110000100
101000000000000000000000000000000000000000000000000...00101111011011000110100101100010011000110010111
00111001101101111001011100011011000100000001011110111010101110011011100100010111101101100011010010110
00100010111101111000001110000011011001011111001101100011010000101101011011000110100101101110011101010
11110000010110101100111011011100111010100101111011011000110100101100010011000110101111101101110011011
11011011100111001101101000011000010111001001100101011001000010111001100001001000000010000001000001010
10011010111110100111001000101010001010100010001000101010001000010000000101000001000000010111101101100
01101001011000100010111101111000001110000011011001011111001101100011010000101101011011000110100101101
11001110101011110000010110101100111011011100111010100101111011011000110010000101101011011000110100101
101110011101010111100000101101011110000011100000110110001011010011011000110100...
#include <stdio.h>
int main(void)
{
printf("hello,
world\n");
}
print("hello, world")
Visual Studio Code for CS-100
cs50.dev
machine code
globals
heap
↓
↑
stack
Albus
Cedric
Draco
Fred
Ginny George
Hermione Harry Hagrid
James
Kingsley
Luna Lily
Minerva
Neville
Petunia
Ron Remus
Severus Sirius
Vernon
Zacharias
#include <stdio.h>
int main(void)
{
printf("hello,
world\n");
}
print("hello, world")
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body hello, body
</body>
</html>
hello, title
input → → output
abstraction
input → → output
algorithm
implementation details
1. Stand up and think of the number 1.
1. Stand up and think of the number 1.
2. Pair off with someone standing, add their number to yours, and remember the sum.
1. Stand up and think of the number 1.
2. Pair off with someone standing, add their number to yours, and remember the sum.
3. One of you should then sit down.
1. Stand up and think of the number 1.
2. Pair off with someone standing, add their number to yours, and remember the sum.
3. One of you should then sit down.
4. If still standing, go back to step 2.
n n/2
log2 n