Data Structures and Algorithms in Java
Data Structures and Algorithms in Java
6th Edition
ISBN: 9781119278023
Author: Michael T. Goodrich; Roberto Tamassia; Michael H. Goldwasser
Publisher: Wiley Global Education US
bartleby

Concept explainers

Question
Book Icon
Chapter 1, Problem 9R
Program Plan Intro

Removing all the punctuations from a string

Program plan:

  • Create a class StringBuilder to remove all the punctuation stored in a string.
    • In main() function,
      • Initially, assign the original string in variable.
      • Then, invoke the removeIt()function to remove all the punctuation in a string and store the final value in original string.
      • Display the string after removing the punctuation in console screen.
    • In the method removeAt(),
      • It passes  input parameter “s” to check whether the character contains punctuation in the string. If yes, then it removes all the punctuation stored in the string “s”.
      • For loop read all the characters from a sentence until the condition leads to false.
      • Then, it calls the function ok() and check whether the character at “j” position matches with the character or not.
        • If the result returns the Boolean value false, then delete the character at the specified position in “j” otherwise store the character using Tostring() method in “s” variable.
    • In the method ok(),
      • It passes input parameter “i” to check whether the character in the sentence matches with the corresponding ASCII values.
        • If yes, then it returns the Boolean value true otherwise it return false.

Blurred answer
Students have asked these similar questions
need help with thi Next, you are going to combine everything you've learned about HTML and CSS to make a static site portfolio piece. The page should first introduce yourself. The content is up to you, but should include a variety of HTML elements, not just text. This should be followed by an online (HTML-ified) version of your CV (Resume). The following is a minimum list of requirements you should have across all your content: Both pages should start with a CSS reset (imported into your CSS, not included in your HTML) Semantic use of HTML5 sectioning elements for page structure A variety other semantic HTML elements Meaningful use of Grid, Flexbox and the Box Model as appropriate for different layout components A table An image Good use of CSS Custom Properties (variables) Non-trivial use of CSS animation Use of pseudeo elements An accessible colour palette Use of media queries The focus of this course is development, not design. However, being able to replicate a provided design…
Using the notation

you can select multipy options

Chapter 1 Solutions

Data Structures and Algorithms in Java

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
CMPTR
Computer Science
ISBN:9781337681872
Author:PINARD
Publisher:Cengage
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning