AP Computer Science Principles by Seth Reichelson
Author:Seth Reichelson [Seth Reichelson]
Language: eng
Format: epub
Publisher: Barrons Educational Series
Published: 2020-04-28T00:00:00+00:00
Example Nineteen
Searching for a Word in a Text-Based Coding List
Line 1: PROCEDURE findNumber (list, word)
Line 2: {
Line 3:index ← 1
Line 4:FOR EACH item IN list
Line 5:{
Line 6:if (item = word)
Line 7:{
Line 8:RETURN index
Line 9:}
Line 10:index ← index + 1
Line 11: }
Line 12: RETURN (“Word not in list”)
Line 13: }
Line 3: Initialize the variable index to equal one, since that is where to begin the search for “word.”
Line 4: This For Each loop will loop for every item in the array. Each iteration then looks at the next object in the array, calling it item.
Line 6 to Line 9: If the current item is the same as the word being searched for, it will return that given index.
Line 10: If the word did not match with the item, continue with the program and increment the index.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Manga Guide to Calculus by Hiroyuki Kojima(496)
AP Computer Science Principles by Seth Reichelson(491)
6 SAT Practice Tests by Philip Geer(488)
500 Key Words for the SAT by Charles Gulotta(438)
The Official ACT Prep Guide 2020--2021 by ACT(435)
AP Art History by John B. Nici(424)
McGraw-Hill Education SAT Elite 2022 by Christopher Black(424)
McGraw-Hill Education SAT Elite 2021 by Christopher Black(400)
McGraw-Hill Education SAT 2021 by Christopher Black(384)
5 Steps to a 5: AP Chinese Language and Culture by JianMin Luo(381)
Princeton Review AP Biology Premium Prep, 2021 by The Princeton Review(372)
Cracking the AP English Literature & Composition Exam, 2018 Edition by Princeton Review(369)
Princeton Review ACT Premium Prep, 2021 by The Princeton Review(359)
Princeton Review AP Biology Prep, 2021 by The Princeton Review(347)
Catholic High School Entrance Exams by Kaplan(346)
Princeton Review AP English Literature & Composition Prep, 2021 by The Princeton Review(344)
Regents Algebra I Power Pack Revised Edition by Gary M. Rubinstein(337)
Fiske Guide to Colleges 2014 by Edward B. Fiske(333)
Tips You Must Know About MS Word (The Complete MBA CourseWork Series) by Ibnalkadi Hicham & Mohamed(325)