--> Skip to main content

Total Pageviews

CT Week 4

Summary

πŸ“š

Selecting cards: Iterator with filtering

This section discusses how to use iterators with filtering to select specific cards from a collection. It involves creating an iterator that can traverse through a collection and apply a filter to select only the desired elements.

Examples

Total spend of one person

This will calculates the total amount spent by a single person. It involves iterating through a list of transactions and summing up the amounts associated with the specified person.

Number of verbs

This will counts the number of verbs in a given text. It involves iterating through the words in the text and applying a filter to select only the verbs.

Sum of both girls’ marks and boys’ marks

This will calculates the total marks obtained by girls and boys separately. It involves iterating through a list of students' marks and summing up the marks based on gender.

Total revenues of each shop

This will calculates the total revenue generated by each shop. It involves iterating through a list of sales transactions and summing up the revenues for each shop.

Number of trains on a specific week day

This will counts the number of trains running on a specific weekday. It involves iterating through a schedule and applying a filter to select the trains running on the specified day. (This will come in week10)

Number of operators in an expression

This will counts the number of operators in a mathematical expression. It involves iterating through the characters in the expression and applying a filter to select the operators.

Number of words in the sentences

This will counts the number of words in each sentence of a text. It involves iterating through the sentences and counting the words in each one.

Compound conditions

Sum of Chennai girls’ marks

This will calculates the total marks obtained by girls from Chennai. It involves iterating through a list of students' marks and applying compound conditions to filter by gender and location.

Compound conditions instead of nested conditions

This section discusses how to use compound conditions to simplify nested conditions. It involves combining multiple conditions into a single logical expression.

Boys born in the first half of the year

This will counts the number of boys born in the first half of the year. It involves iterating through a list of students' birth dates and applying compound conditions to filter by gender and birth date.

Number of high scorers

This will counts the number of students who scored above a certain threshold. It involves iterating through a list of marks and applying a filter to select the high scorers.

Sequence of conditions is not the same as AND or OR

This section explains that the sequence in which conditions are evaluated can affect the outcome, and it is not always equivalent to using AND or OR operators.

Looking for a data element

Search for a high scoring student

This searches for a student who scored above a certain threshold. It involves iterating through a list of students' marks and applying a filter to find the high scorers.

To write pseudocode effectively, focus on understanding the question thoroughly. With a solid grasp of the topics mentioned above, you’ll be able to generate ideas and solutions more easily.

PA:

GA:

Comments