CT Qual
CT Qual
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”.
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.
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.
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:
Disadvantages of Flowchart:
Computational Thinking 2
Difficult to reproduce the flowcharts.
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
Subtypes:
Integers:
Dates, Marks, Quantity, Ranks, count
Charecter:
Gender
Strings:
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
Initialise to MaxCardId=-1
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
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