This is my Project for the Intro to IT course from codecademy.com. No cool background for me, taking a few courses for fun. So... here it is.
Part 1: Plan and write algorithm#
1. Create a variable called “text” (text=””), enter the value of “text” (test=”2022 world cup standings”)
- Create a variable called “pattern” (pattern=””), enter the value of “pattern” (pattern=” world cup”)
- Create “match_count” variable, set the value to 0
- Has the text value been searched?
◦ If no, go to step 5
◦ If yes, skip to step 7
- Iterate to the next word in “text”
- Is the value of “text” and “pattern” equal?
◦ If yes, go to step 7
◦ If no, return to step 5
- If “match_count” is equal to the length of pattern, then pattern found.
If not, pattern not found.
Part 2: Create a flowchart
Part 3: Test the Chart
1. text = "ERROR: Invalid function arguments"; pattern = "ERROR"
- text = "ERROR: Out of memory"; pattern = "network"
- text = "ERROR: The file is write-protected"; pattern = "protected" Solution: I will conduct an analysis inputs to make sure it works as expected.
Part 4: Produce the Pseudocode#
Define “text” (text=”?”)
Define “pattern” (pattern=”?”)
If entire pattern hasn’t been searched:
Move on to next character of the text
Create “match_count” set to 0
If entire pattern hasn’t been searched:
if this character from the pattern is equal to the character from text:
increment match_count variable by 1
if match_count is equal to the length of the pattern:
pattern found
otherwise:
no pattern found
Conclusion
This is the end of my first Software Development Concepts project from Codecademy. Honestly, I’d like to give a shout out to dev.to user Liudmyla, I appreciate the work that was done in this project. It shed a ton of light for me and was as great help. So, thanks to you Liudmyla for your work! Great Job! If anyone sees this and wants to see a better looking project here’s the link to Liudmyla’s project.
Latest comments (1)
Nice start.