- Notes and pointers for the NPTEL Course by Abhiram Ranade
- This repository will be in accordance with the run of January 2022 - April 2022
- Computers are everywhere!
- Computer is defined as a giant electrical circuit that can receive data from external world, perform the calculations and send data to external world.
- Calculations depend on the program
- Program: a precise description of calculations we want the computer to perform
C++
: Developed by Bjarne Stroustrup in 1985, evolved out of C programming language- Programming environment provided by SimpleCPP developed by IITB for beginners to programming
- The recommended textbook is written by the author of the course, Dr. Abhiram Ranade
- Introduction to C++ programs using SimpleCPP: Turtle Simulator inspired by the Logo software created by Seymour Pappert et al. to introduce children to programming.
- To run this program:
s++ <fileName>.cpp
./a.out
repeat
statement: used to avoid redundant work by including the iterative work as thebody
of this statement. Each execution is callediteration
. Syntax:repeat(x) { yyy }
. Therepeat
statement causes the statementsyyy
in{}
to be repeatedx
times.left(A)
: turn leftA degrees
. Equivalent toright(-A)
sqrt(x)
: square root ofx
sine(x)
,cosine(x)
,tangent(x)
:x
should be in degreessin(x)
,cos(x)
,tan(x)
:x
should be in radianspenUp()
,penDown()
: Causes the pen to be raised, lowered; drawing happens only if the turtle moves while the pen is lowcin
andcout
: used to accept input and produce output respectively- Statement/command terminated by
;
- Commands are executed from top to bottom. and left to right
Arguments
: additional data needed by command to do its workSyntax
: Grammatical rules indicating how commands must be writtenComments
: Ignored by compiler, read by people/* This is a multiline comment */
// Single line comment until end of line
Indentation
: Spacing that allows human readers to read code more elegantly, if "X" inside "Y", then we give two spaces in before the start of "Y"Nested repeat
statements:repeat(x) { yyy }
: executeyyy
x
times- If
yyy
containsrepeat(w) { zzz }
, then thezzz
is executedw
times in each execution ofyyy
Control is at statement w
: Computer is currently executing statement w.Control flow
: The order in which statements get executed. Generally, top to bottom, gets retraced if repeat statement.Variable
: region of memory designated for storing some value you need.
-
Modelling real life problems as mathematical problems on a high level overview basis
-
Remember: Computers are for computations
-
Computer Vision/Image Processing: Converting an black-white image into a sequence
0
s and1
s- Grey scale: We denote each pixel using "grey"ness values of
0.1
to1.0
- Colored: We represent each pixel using
red
,blue
andgreen
component to obtain the required mix
- Grey scale: We denote each pixel using "grey"ness values of
-
Weather prediction: Used to divide the surface of the earth into small regions. Each region is represented using
pressure
,temperature
andhumidity
-
Language/text representation using numbers: Each character is mapped to a number. For example, a traditional system that is followed is the ASCII (American Standard Code for Information Interchange)
-
Historical remark: Computers are used to solve problems, but problem solving is not new, humans have been solving numerical problems for millenia