[SOLVED] Lab 13 Java Programming

25.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab14-histogram-4dxtgj.zip (18.6 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

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:

  • Lab14-histogram-4dxtgj.zip