Skip to content

Commit

Permalink
removed images
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitd3 committed Apr 28, 2023
1 parent 65a0968 commit c2f8a18
Showing 1 changed file with 74 additions and 4 deletions.
78 changes: 74 additions & 4 deletions _notebooks/2023-04-27-frqpractice2017.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,32 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"862\" alt=\"image\" src=\"https://user-images.githubusercontent.com/44128572/235208661-6e94ac88-4d2a-44ee-8b14-aba760486a83.png\">\n"
"a)\n",
"\n",
"+1 Constructs digitList\n",
"\n",
"+1 Identifies a digit in num\n",
"\n",
"+1 Adds at least one identified digit to a list\n",
"\n",
"+1 Adds all identified digits to a list (must be in context of a loop)\n",
"\n",
"+1 On exit: digitList contains all and only digits of num in the correct order\n",
"\n",
"b)\n",
"\n",
"+1 Compares at least one identified consecutive pair of digitList elements\n",
"\n",
"+1 Determines if a consecutive pair of digitList is out of order (must be in context of a\n",
"digitList traversal)\n",
"\n",
"+1 Compares all necessary consecutive pairs of elements (no bounds errors)\n",
"\n",
"+1 Returns true iff all consecutive pairs of elements are in order; returns false otherwise"
]
},
{
Expand Down Expand Up @@ -214,7 +236,22 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"862\" alt=\"image\" src=\"https://user-images.githubusercontent.com/44128572/235208844-ef9f0b16-e3cb-46d2-ae38-d7d2fcee223f.png\">\n"
"a)\n",
"+1 Declares header: public class MultPractice implements StudyPractice\n",
"\n",
"+1 Declares all necessary private instance variables\n",
"\n",
"+1 Initializes all instance variables using parameters\n",
"\n",
"+1 Declares header: public String getProblem()\n",
"\n",
"+1 Builds string with current values of instance variables\n",
"\n",
"+1 Returns constructed string\n",
"\n",
"+1 Declares header: public void nextProblem()\n",
"\n",
"+1 Updates instance variable(s) to reflect incremented second number"
]
},
{
Expand Down Expand Up @@ -318,7 +355,26 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"881\" alt=\"image\" src=\"https://user-images.githubusercontent.com/44128572/235209030-ffe72e8a-41d5-4656-8141-a1d925cb05c4.png\">\n"
"a)\n",
"+1 Calls findNthOccurrence to find the index of the nth occurrence\n",
"\n",
"+1 Preserves currentPhrase only if nth occurrence does not exist\n",
"\n",
"+1 Identifies components of currentPhrase to retain (uses substring to extract before/after)\n",
"\n",
"+1 Creates replacement string using identified components and repl\n",
"\n",
"+1 Assigns replacement string to instance variable (currentPhrase)\n",
"\n",
"b)\n",
"\n",
"+1 Calls findNthOccurrence to find the index of the nth occurrence\n",
"\n",
"+1 Increments (or decrements) the value used as n when finding nth occurrence\n",
"\n",
"+1 Returns the index of the last occurrence, if it exists\n",
"\n",
"+1 Returns -1 only when no occurrences exist"
]
},
{
Expand Down Expand Up @@ -509,7 +565,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"875\" alt=\"image\" src=\"https://user-images.githubusercontent.com/44128572/235210109-e8736de1-6d23-4c25-a1ed-0ea10b6f7576.png\">"
"a)\n",
"\n",
"+1 Accesses all elements of arr, (no bounds errors on arr)\n",
"\n",
"+1 Initializes, computes, and returns sum of elements\n",
"\n",
"b)\n",
"\n",
"+1 Constructs correctly-sized 1D array of ints\n",
"\n",
"+1 Accesses all rows in arr2D (no bounds errors on arr2D)\n",
"\n",
"+1 Computes sum of row in arr2D using arraySum and assigns to element in 1D array\n",
"\n",
"+1 Returns 1D array where kth element is computed sum of corresponding row in 2D array for all rows"
]
},
{
Expand Down

0 comments on commit c2f8a18

Please sign in to comment.