1 / 6

Session Objectives #U2S11

Session Objectives #U2S11. Key Words. Locate. String. Built-in. MID. Length. LEFT. String Manipulation - Extraction. Most languages have built-in functions to extract part of a string , often being called LEFT, RIGHT or MID LEFT (<string>, <number of characters>)

Download Presentation

Session Objectives #U2S11

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Session Objectives#U2S11

  2. Key Words Locate String Built-in MID Length LEFT

  3. String Manipulation - Extraction Most languages have built-in functions to extract part of a string , often being called LEFT, RIGHT or MID LEFT (<string>, <number of characters>) i.E LEFT (“Computing”, 3) returns “Com” but MID (<string>, <starting position>, <number of characters>) i.e(“Computing”, 4, 3) returns “put” TASK: Experiment with the string extract functions using Python and then Javascript. Is the syntax and logic the same?

  4. String Manipulation – Length Again, ,most languages have a function to calculate the number of characters in a particular string, usually: LENGHTH (<string>) i.e LENGTH (<“Computing”>) returns 9 TASK: Try this in Python or Javascript. It is particularly useful validate passwords and increase strengths based on the numbers of characters used. EXT: Design, create and test a program that will encourage strong passwords to be used. What will you have to do first in order to write a suitable software solution?

  5. Password Program Problem analysis: The program MUST • Take user input and store as string • Measure length of string • Make decision based on length whether Strong, Medium or Weak • Output Decision

  6. String Manipulation - Locate Another common in-built function is facilitate the ability to search a string for certain sequences of characters. i.e LOCATE (<search string>, <main string> This varies between languages LOACTE (“put”, “Computing”) would return 4 as it is found from the 4th character along in the string. TASK: Attempt in Python or Javascript and test to see working by getting results of 0 and above. TASK 2: Complete Questions 1-2 in the Activity on p.106 EXT: Create the program in Q3.

More Related