0% found this document useful (0 votes)
12 views

CT Qual

Uploaded by

Himanshu Yadav
Copyright
© © All Rights Reserved
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)
12 views

CT Qual

Uploaded by

Himanshu Yadav
Copyright
© © All Rights Reserved
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/ 17

Computational Thinking

Week 1

Flow Charts
What is a Flowchart?
Flowchart is a graphical representation of an algorithm. Programmers often use
it as a program-planning tool to solve a problem. It makes use of symbols
which are connected among them to indicate the flow of information and
processing.
The process of drawing a flowchart for an algorithm is known as “flowcharting”.

Basic Symbols used in Flowchart Designs

 Terminal: The oval symbol indicates Start, Stop and Halt in a program’s
logic flow. A pause/halt is generally used in a program logic under some
error conditions. Terminal is the first and last symbols in the flowchart.

Input/Output: A parallelogram denotes any function of input/output type.


Program instructions that take input from input devices and display output
on output devices are indicated with parallelogram in a flowchart.

Processing: A box represents arithmetic instructions. All arithmetic


processes such as adding, subtracting, multiplication and division are
indicated by action or process symbol.

Computational Thinking 1
Decision Diamond symbol represents a decision point. Decision based
operations such as yes/no question or true/false are indicated by diamond
in flowchart.

Connectors: Whenever flowchart becomes complex or it spreads over


more than one page, it is useful to use connectors to avoid any confusions.
It is represented by a circle.

Flow lines: Flow lines indicate the exact sequence in which instructions are
executed. Arrows represent the direction of flow of control and relationship
among different symbols of flowchart.

Advantages of Flowchart:

Flowcharts are better way of communicating the logic of system.

Flowcharts act as a guide for blueprint during program designed.

Flowcharts helps in debugging process.

With the help of flowcharts programs can be easily analyzed.

It provides better documentation.

Flowcharts serve as a good proper documentation.

Disadvantages of Flowchart:

It is difficult to draw flowchart for large and complex programs.

In this their is no standard to determine the amount of detail.

Computational Thinking 2
Difficult to reproduce the flowcharts.

It is very difficult to modify the Flowchart.

Example : Draw a flowchart to input two numbers from user and display the
largest of two numbers

Example:

Sanity of Data
The sanity of data: what we observed
• We organized our data set into cards, each storing one data item
• Each card had a number of elements, e.g.:
• numbers (e.g. marks)
• sequence of characters (e.g. name, bill item, word, etc)
• We observed that there were restrictions on the values each element
can take:
• for example marks has to lie between 0 and 100
• name cannot have funny characters
• Constraints on the kinds of operations that can be performed:
• addition of marks is possible
• but a multiplication of marks does not make sense!

Computational Thinking 3
• compare one name with another to generate a boolean type True or False)
• but cannot add a name with another!

Data Types
Data types are of 3 kinds

 Charecter - Alpha-Numerics, Special Symbols - We can't perform any


operations on this type of data - Result type - undefinded

 Integers - Numerics range from Minus infinty to plus infinity - operations


+,-,*,/,%, <,> - Result type: Integer or boolean

 Boolean True or False - operations AND, OR - result type Boolean

Subtypes:

Integers:
Dates, Marks, Quantity, Ranks, count

Charecter:

Gender

Strings:

Names, City Words, Catagory


4. Record - Data type with multiple fields - each of which has a name and a
value Struct or Tuple)

Examples of Record:
Marks card , Words in a Paragraph , Shopping bills

List
• A sequence of data elements (for example a sequence of records)
• MarksCardList - is the data type for our data set of all marks cards
• Each element in the sequence is of MarksCard Record data type
• ParagraphWordList - is the data type for our word data set
• Each element in the sequence is of WordInPara Record data type
• ShoppingBillList - data type for the shopping bill data set
• We need to define the Record data type for a shopping bill

Computational Thinking 4
Computational Thinking 5
Computational Thinking
Week 2

To find Max marks

 To Find max marks: Replace initialise with Max=0

 Replace Check for with Maths marks of Card X > max? if


so, update max

To find Maths max marks

 Initialise to MaxCardId=-1

 Replace do something to max = CardX.Maths, maxCardId =


CardX.id

Computational Thinking 1
Computational Thinking 2
Computational Thinking 3
Computational Thinking 4
Computational Thinking
Week 3
Extraction of data and Creation of tables
1.Data on cards can be naturally represented using tables
2.Each attribute is a column in the table
3.Each card is a row in the table
4.Difficulty if the cards has a variable number of attributes Items in shopping
bill
5.Multiple rows | duplication of data
6.Split as separate tables and need to link via unique attribute
Tables

Procedures
A Procedure is a block of organized, reusable code that is used to perform a
single, related action. Procedure provide better modularity for your application
and a high degree of code reusing.

Example:

To call a Procedure,

Computational Thinking 1
use the Procedure name followed by parenthesis

 A procedure may not return a value

 Procedure call is a separate statement

 Use a procedure when the same computation is used for


differentsituations

 Parameters fix the context

 Use variables to save values returned by procedures

 Keep track of the outcomes of multiple procedure calls

 Procedures help to modularize pseudocode

 Avoid descibing the same process repeatedly

 If we improve the code in a procedure, benet automatically applies to all


procedure calls

Computational Thinking 2
Computational Thinking 3
Computational Thinking 4
Computational Thinking 5
Computational Thinking 6
Computational Thinking
Week 4
Binning method is used to smoothing data or to handle noisy data. In this
method, the data is first sorted and then the sorted values are distributed into
a number of buckets or bins. As binning methods consult the neighborhood of
values, they perform local smoothing.

Example

Computational Thinking 1
Computational Thinking 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy