Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Instructor note: Recall that userText.charAt(x) returns the character located at index x. Recall that userText.length() returns the number of characters in String userText

In Java

Instructor note:

Recall that userText.charAt(x) returns the character located at index x. Recall that userText.length() returns the number of characters in String userText Since characters are primitive data types, the following conditions are valid if (userText.charAt(x) == '.')...... Outline of code might look like this: Read userText Use for loop to generate the indexes associated with userText check if the userText.charAt(index) is a blank, comma, or period if it is, then increment a counter display number of characters in userText minus the counter 

Given a line of text as input, output the number of characters excluding spaces, periods, exclamation points, or commas.

Note: Account for all characters that aren't spaces, periods, exclamation points, or commas (Ex: "r", "2", "?").

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions