Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The static void main method will prompt the user to enter the text of a tweet using the prompt shown above in the sample run.

  1. The static void main method will prompt the user to enter the text of a tweet using the prompt shown above in the sample run.
  2. It will contain a value method countNumberSigns(tweetText) that will take a String tweetText containing the text of a tweet and return the number of '#' characters in the tweet.
  3. It will contain a value method countHashtags(tweetText) that will take a String tweetText containing the text of a tweet and return the number of hashtags in the tweet. A hashtag is defined precisely below, but it is basically a word starting with '#'. Words that have '#' somewhere after their start aren't hashtags unless they also start with '#'.
  4. The static void main method prints the number of hashtags and number signs found in the entered text as shown in the last line of output in each of the examples above.
  5. There are many ways to write the two methods in this program. However, this is a class where we are learning to program, and we need to not use the most powerful ways we might find via Google or other routes. The only way for which you will receive credit is to use a String traversal and process the String one character at a time.

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

Explain what a constant is.

Answered: 1 week ago