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.
Top comments (1)
Nice start.