0% found this document useful (0 votes)
22 views6 pages

CornellNotes Week 1

CornellNotes Week 1 on Python

Uploaded by

laurajackson433
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views6 pages

CornellNotes Week 1

CornellNotes Week 1 on Python

Uploaded by

laurajackson433
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

Week: Week1__________ Name: Theophilus Amaye______________

Assignment: Computational thinking skills Class: _CS105_Intro to Programming____


Page 1 of 6 Date: 28-October-2023__________ __

Instructions: You must read the material and create an outline of the topics in your OWN words. Do not copy
the text from the tutorials into your notes. Make sure your outline contains notes for each subsection of the
reading assignment. Thoroughly cover each topic to show you have a firm understanding of the programming
concept or construct.

Ques NOTES:

Pseudocode Pseudocode is an unconventional display of computer code or


algorithms in a format that is more readable and understandable
to humans. It is intended to provide simplicity for complex code or
algorithms.

Key Points to Note  A pseudocode is not restricted to a programming language.


 It is a learning tool used to simplify how to write actual
code.
 A pseudocode does not have a know rule of structure.

Pseudocode vs Actual Instead of an actual C++ code written as;


Code int main()
{
int num;
cout<<"Enter a number";
cin>>num;
if(num%2==0)
cout<<"Even Number";
else
cout<<"Odd Number";
}
A pseudocode that will be readable can be:

BGEIN
num = INPUT: "Enter a number"
IF num MOD 2 == 0
print "Even Number"
ELSE
print "Odd Number"
END
Week: Week1__________ Name: Theophilus Amaye______________
Assignment: Computational thinking skills Class: _CS105_Intro to Programming____
Page 2 of 6 Date: 28-October-2023__________ __

Ques NOTES:
Why Use Pseudocode? Apart from serving as a blueprint for actual code, pseudocode can
provide the following benefits:
 It fosters team work by making code readable to other
professionals who may not have knowledge of the
programming language being used.
 Being a blueprint for actual code, it makes coding simpler
and faster.
 It helps a person find bugs more quickly and easily.

How to write a Using the same logic as a programming code, you can create a
pseudocode pseudocode using English language by doing the following:

1. Use any text editor of your choice


2. Give an overview of the project the pseudocode is being
used for.
3. Maintain the flow of an actual code require for the program
to work.
4. Make the pseudocode neat but using indentations and
white spaces.
5. Write command keys in capital letters. e.g.
PRINT (“Hello”).
6. Terms in the pseudocode should be as simple as possible
e.g., “IF”, “WHEN”, etc.
7. Curly braces should be used to organize the pseudocode
into sections to display where the commands start or ends.
Comments can also be added using “//” explain the code.
8. Crosscheck to make sure the pseudocode serves its
purpose and can be easily turned into actually code while
at the same time maintaining simplicity.
Standard Conventions to Common rules involved in writing a pseudocode include the
Write Pseudocode following;
 Capitalization of command words
 Only one statement should be written per line.
 Indentation should be used to show structure of the block
of code intended.
 Avoid ambiguity when making statements.
Operators;
Pseudocode for Different
Week: Week1__________ Name: Theophilus Amaye______________
Assignment: Computational thinking skills Class: _CS105_Intro to Programming____
Page 3 of 6 Date: 28-October-2023__________ __

Ques NOTES:
Statements Assignment Operator: =, <- or :=
Comparison Operator: == , !=, <, >, <= , and >=
Arithmetic Operator: +,-, *, /, MOD(%)
Logical Operator: AND, NOT and OR
Sum, Product: ? ?

Special Keyword
1. START: To begin the pseudocode.
2. INPUT : Take input from the user.
3. PRINT: To print the output on the screen.
4. READ/GET: Input format while reading data from the file.
5. SET, INIT: Initialize a value.
6. INCREMENT, BUMP: Increase the value of the variable,
equivalent to a++.
7. DECREMENT: Decrease the value of the variable,
equivalent to a--.
8. COMPUTE, CALCULATE, DETERMINE: To calculate the
expression result.

Write the FizzBuzz FizzBuzz algorithm is used to write numbers in a simpler form.
Algorithm Using 1-30 is written in a new line. Multiple of 3 is written as Fizz,
Pseudocode multiple of 5 is written as Buzz and for numbers with multiples of
both 3 and 5 is written as FizzBuzz.

Advantage of  Easy to understand


Pseudocode  Clear syntax
 Describes functions of each line

Disadvantage of  Anyone official format.


Pseudocode
 No visual representation of program.

 Need for additional documentation.

Flowchart A flowchart is a diagram representing an algorithm, showing how


a task is accomplished. Flowchart usually use a structure of
problem and solution or process and decision. Processes are
Week: Week1__________ Name: Theophilus Amaye______________
Assignment: Computational thinking skills Class: _CS105_Intro to Programming____
Page 4 of 6 Date: 28-October-2023__________ __

Ques NOTES:
represented using a rectangular box and decisions are
represented by a diamond.
The flow process chart, introduced by Frank and Lillian Gilbreth
in 1921, marked the early structured method for documenting
process flow. These tools quickly became part of industrial
engineering curricula. In the 1930s, Allan H. Mogensen started
teaching business professionals industrial engineering tools at his
Work Simplification Conferences. Later, these methods influenced
Procter and Gamble and other industries. The flowchart's
application evolved into describing computer algorithms, though
its popularity declined in the 1970s with the advent of interactive
computer terminals and high-level programming languages.
Pseudo-code and modern techniques like UML activity diagrams
have since become the norm for algorithm description in the 21st
century, expanding upon the original concept of the flowchart.

Types of Flowcharts Flowcharts can be categorized into various types based on the
aspects they represent within a system:
1. Document Flowcharts: These depict the controls governing
the movement of documents through a system.
2. Data Flowcharts: These illustrate the controls regulating the
flow of data within a system.
3. System Flowcharts: These showcase the controls
established at a physical or resource level within a system.
4. Program Flowcharts: These reveal the controls existing
within a program as part of a broader system.

Common Symbols Is used to represent the order of operation.

Represents the operation

Represents the decision which will to determine


which part the flow will take.
Week: Week1__________ Name: Theophilus Amaye______________
Assignment: Computational thinking skills Class: _CS105_Intro to Programming____
Page 5 of 6 Date: 28-October-2023__________ __

Ques NOTES:

Represent the beginning or end of a program.

Represent input or output.

Represent added comment

Represent data or database

Represent file

Parallel Processing Parallel processing in a flowchart is shown using two horizontal


lines.
Diagramming Any drawing software can be used to make a flowchart. They are
special software that can generate flowcharts from a source code.
What is the significance Flowcharts are essential tools for process design and planning,
of a flowchart? offering a comprehensive overview of a process by arranging
tasks in chronological order and categorizing them. Notably,
flowcharts separate the steps from implementation, focusing on
what each step should achieve, the required input, and expected
output. They also help reveal hidden inefficiencies and areas for
improvement, like bottlenecks and redundancies, making them
dynamic tools for process refinement. While they have limitations
and are often used alongside other diagrams, it's important to
acknowledge their historical significance, originating as flow
process charts in 1921, and their role in early computing,
Week: Week1__________ Name: Theophilus Amaye______________
Assignment: Computational thinking skills Class: _CS105_Intro to Programming____
Page 6 of 6 Date: 28-October-2023__________ __

Ques NOTES:
particularly in Visual Programming Languages.

You might also like