[SOLVED] Lab 13 Java Programming

25.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

1. Declare and implement a class named Histogram. This class will have a string data member and the following methods:

Data members:

String text

Methods:

constructor – initialize text with “I love problem-solving.”.

setText(String t) – set text to t.

drawHistogram() – count each alphabet letter, store the counts in an array and plot the counts using a vertical histogram. As an example, if text = “I love problem-solving.”, this method should plot:

*     *

*       *     *     *             *

*     *   *   *     * * * * *   * *     *

—————————————————

a b c d e f g h i j k l m n o p q r s t u v w x y z

Note that all special characters including blanks are ignored and alphabet letters are case-insensitive.

 

Your main program should use the following menu:

T: Enter a text

P: Plot frequencies

Q: Quit

Select:

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.