0% found this document useful (0 votes)
5 views2 pages

Cs 101 Final Term

Lectures 88 and 89 focus on the representation of algorithms, emphasizing the importance of clarity in their description. Lecture 88 introduces primitives as basic building blocks with specific syntax and semantics, while Lecture 89 discusses pseudocode as an informal yet clear method for writing algorithms. Key takeaways include the significance of using primitives and pseudocode for easier understanding and planning of algorithms before coding.

Uploaded by

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

Cs 101 Final Term

Lectures 88 and 89 focus on the representation of algorithms, emphasizing the importance of clarity in their description. Lecture 88 introduces primitives as basic building blocks with specific syntax and semantics, while Lecture 89 discusses pseudocode as an informal yet clear method for writing algorithms. Key takeaways include the significance of using primitives and pseudocode for easier understanding and planning of algorithms before coding.

Uploaded by

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

Simplified Summary of lecture 88 & 89

Lecture 88
1. Algorithm: Representation (Primitives)
What It Means:
• To represent algorithms, we need a clear and precise way to describe them.
• Using natural languages (like English) or pictures can cause confusion because:
• Words can have double meanings.
• The level of detail may not be enough.
Primitives:
• A primitive is a basic building block used to write algorithms.
• Each primitive has:
• Syntax: How it looks (its symbol).
• Semantics: What it means (its purpose).
• Example: "Air" has symbols (syntax) and means a gas (semantics).
Programming Languages:
• Programming languages use primitives and rules to create algorithms.
• Machine Language: Very basic and detailed, meant for computers but hard for humans to
use.
• Higher-Level Languages: Simplified and easier to understand for humans.

Lecture 89
2. Algorithm: Representation (Pseudocode)
What It Means:
• Pseudocode is a simple, informal way to write an algorithm.
• It doesn’t follow strict programming language rules but is still clear enough to understand.
Key Features:
1. Assignments: Storing a value for later use.
• Example:
RemainingFunds = CheckingBalance + SavingsBalance

This saves the total of CheckingBalance and SavingsBalance into


RemainingFunds.
2. Conditions (If-Else): Choosing between two actions based on a condition.
• Example:
if (year is leap year):
daily_total = total / 366
else:
daily_total = total / 365

Here, the total is divided by 366 if it’s a leap year, otherwise by 365.
Why Use Pseudocode:
• It’s easier to write and understand.
• Helps to plan algorithms before converting them into actual code.

Key Ideas
1. Clarity is Important: Algorithms should be written in a way that everyone understands.
2. Primitives: Basic tools that make writing algorithms easier and clearer.
3. Pseudocode: A flexible, simple way to describe how an algorithm works before writing
actual code.

You might also like