Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

FOR C#! Character Counter - Vector Design a program that reads in an ASCII text file (provided) and creates an output file that contains each

FOR C#!

Character Counter

-

Vector

Design a program that reads in an ASCII text file (provided) and creates an output file that contains each unique ASCII character and the number of time the character appears in the file. Do not sort the output. Each unique character in the file must be represented by a character frequency class instance. For this exercise, the character frequency objects must be stored in a vector.

For example, given the sample input file: Hello.

The output file would look like this:

H(72) 1

e(101) 1

l(108) 2

o(111) 1

.(46) 1

The program should be able to be executed from the command line using the following syntax:

programname.exe (optional for this assignment).

For example, counter.exe myInput.txt Count.txt

Where counter.exe is the program name, myInput.txt is the input ASCII file, and the Count.txt is the output file.

The character frequency class must implement the essence of the object described in the UML diagram below. Note that methods described in the UML diagram below are not absolute and may be changed as desired as long as the basic functionality is preserved.

image text in transcribed

CharacterFrequency -ch: char -frequency: int +getCharacter() : char +setCharacter(in character : char) +getFrequency(): int +setFrequency (in frequency: int) tincrement() +Equals() bool +ToString(): string

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

Database And Expert Systems Applications Dexa 2022 Workshops 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 In Computer And Information Science 33

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Alfred Taudes ,Atif Mashkoor ,Johannes Sametinger ,Jorge Martinez-Gil ,Florian Sobieczky ,Lukas Fischer ,Rudolf Ramler ,Maqbool Khan ,Gerald Czech

1st Edition

ISBN: 3031143426, 978-3031143427

More Books

Students also viewed these Databases questions