Question

Advanced Programming PENN FOSTER Introduction to Programming : Advanced Programming Lesson 4 Overview You've learned many valuable lessons on programming and logic. In this final lesson, you'll learn more advanced

programming techniques. First, you'll learn about text processing. You'll 4 also learn about recursion and how you can use it to solve problems. Next, you'll learn about object-oriented programming. Lastly, you'll learn about GUIs and event- driven programming. 4.1 Describe the use of character-by-character text processing Text Processing READING ASSIGNMENT Read this assignment. Then, read Chapter 12 of your textbook. Occasionally, you'll need to work with strings on a detailed level. An © 2020 Penn Foster Inc. Introduction to Programming (v1) : Lesson 4: Page 1 example would be accessing or manipulating individual characters in a string. This process is called character-by-character text processing. In many languages, you would use subscript notation to represent these characters as if they were in an array. The first character is represented by subscript 0, the next by subscript 1, and so on. The subscript of the last character would be one less than the string's length. For example, if there were five characters in the string, you would use the subscripts 0 through 4. Many languages also allow you to work with single characters with library functions. You can view a list of single-character library functions in Table 12.2 of your textbook. Additionally, your textbook provides a walkthrough of how to perform the following tasks related to text processing: Validating a password • Inserting and deleting characters in a string • Formatting and unformatting telephone numbers ● Make sure to answer the checkpoints in the textbook as you read the chapter. Check your answers in Appendix E at the back of your textbook. Key Points and Links READING ASSIGNMENT Key Points © 2020 Penn Foster Inc. Introduction to Programming (v1) : Lesson 4 : Page 2 Accessing or manipulating individual characters in a string is a process called character-by-character text processing. • In many languages, you would use subscript notation to represent characters as if they were in an array. • The subscript of the last character would be one less than the string's length. ● • Many languages also allow you to work with single characters with library functions. • You can use text processing to validate passwords, insert and delete characters in a string, and format and unformat telephone numbers. ● Exercise: Text Processing Answer the Review Questions and the following exercises at the end of Chapter 12 in your textbook: ● Algorithm Workbench 1, 4, and 7 Debugging Exercises 1 and 3 • Programming Exercise 6 Exercise Answer Key: Exercise: Text Processing Review Questions Multiple Choice © 2020 Penn Foster Inc. Introduction to Programming (v1) : Lesson 4 : Page 3 1. B 2. D 3. C 4. B 5. A True or False 1. True 2. False 3. False 4. True 5. False 6. False (They return the converted characters.) 7. True Short Answer 1. The first character's subscript is 0, and the last character's subscript is the string's length, -1. 2. BirthdayHappy 3. Yadayada 4. A-B-C-D- 5. aBbDd Answers for the Algorithm Workbenches, Debugging Exercises, and Programming Exercise are in the CSC105 Lesson 4 Additional Exercise Answers supplement. © 2020 Penn Foster Inc. Introduction to Programming (v1) : Lesson 4 : Page 4