A lot of the time we spent in class was not working, but more explaining what this course was to the newer students. I had heard this all way back in August, so it was nothing new to me. Simply Mr. Daly explaining how exactly this course works, about the blog, how grades are and other important things to know. After that, he assigned us all an initial questionnaire. Since I had already completed that one in August, some others that were here last semester and I got a slightly different questionnaire.
When I finally got to work, there wasn't much time left in class. Only about 20 minutes. I got to work on strings, but with many interruptions because of new people asking me how things work and how to do this or to do that. When I finally got to work, I only completed two problems.
There was one problem, however, was something new. It was a string problem which I had never encountered before. I required Mr. Daly's help with it, because it was quite complex in my eyes. It included everything that I would need to know about strings. Concatenation, str.substring with one and two properties, str. length, and assigning values. Really, everything.
Here it is:
Given a string and an int n, return a string made of the first and last n chars from the string. The string length will be at least n. nTwice("Hello", 2) → "Helo" nTwice("Chocolate", 3) → "Choate" nTwice("Chocolate", 1) → "Ce" |

No comments:
Post a Comment