Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me write this code in java and clss name should be NumberOfLetters please do thoroughly dont give me what someone else already did.

image text in transcribed please help me write this code in java and clss name should be NumberOfLetters please do thoroughly dont give me what someone else already did.
image text in transcribed
Do the problem #1 on page 571 of the text. Write a program that will read a line of text that ends with a period, which serves as a sentinel value. Display all the letters that occur in the text, one per line and in alphabetical order, along with the number of times each letter occurs in the text. Use an array of base type int of length 26, so that the element at index 0 contains the number of a's, the element at index 1 contains the number of b's, and so forth. Allow both uppercase and lowercase letters as input but treat uppercase and lowercase versions of the same letter as being equal. (Hints: Use one of the methods to UpperCase or to LowerCase in the wrapper class Character. You will find it helpful to define a method that takes a character as an argument and returns an int value that is the correct index for that character. For example, the argument 'a' results in 0 as the return value, the argument 'b' gives 1 as the return value, and so on. Note that you can use a type cast, such as (int) letter, to change a char to an int. Of course, this will not get the number you want, but if you subtract (int)'al, you will then get the right index.) Allow the user to repeat this task until the user says she or he is through. Add 5 comment lines (comment lines start with //) at the very top of your program with your name, your class and section, the project number, due date, and a short description of the program Please submit the followings to me on the due date. 1) Java source code (java file) 2) UML diagram with comments. (Refer to Figure 52 (Page 777 Output: Sample 1 Please enter the text ending with a period: abbcdffsrr. Letter: a freq. 1 Letter: b freg. 2 Letter: c freq. 1 Letter: d freq. 1 Letter: f freq. 2 Letter: r freq. 2 Letter: s freq. 1 Would you like to try another text? (Yes/No)

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago