Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ PROGRAM I just need some additional code on my program, i need to show the bytes on each number. OUTPUT ON MY PROGRAM, NUMBER

C++ PROGRAM

I just need some additional code on my program, i need to show the bytes on each number.

OUTPUT ON MY PROGRAM, NUMBER OF BYTES MUST SHOW AFTER THE * (asterisk)

image text in transcribed

image text in transcribed

CODE:

#include #include #include #include using namespace std; // Ask user for filename and open it for reading in binary mode void inputFileDetails(ifstream &ifs) { string fn; cout> fn; ifs.open (fn, ios::in | ios::out | ios::binary); if (!ifs.is_open()) { cout max) max = counters[i]; } void displayDistribution(int counters[],int max) { // Plot the distribution after applying scaling for (int i = 0; i

} int main() { string fn; int counters[256], max = 0, totalbytes = 0; // keep track of how many of each char (0 to 255) in counters for (int i = 0; i

//call functions inputFileDetails(ifs); countTotalBytes(ifs,counters,totalbytes); findMax(counters,max); displayDistribution(counters,max); displayStatistics(max,totalbytes); return 0; }

* ********* Enter filename: C:\Users\Acer\Desktop\1.png a ******************************************* 1 ******************** 2 *************************** 3********************* 4 ******************************* ************************ S ********************** 9 ************************** L 8 ***************************** ************************** 6 **************************** L 11 ************** 12 ************************** 13***************** 14 *************************** 15 ****** 16 **************************** **************************** LL ******************************* L **************************** 6L ******************************* 21 *************************** 22 ************************** 23 **************** 24 25 ************************* 26 *************************** 27 ***************** 28 ******************** 29 ****************** 38 ******************* 31 ***************** 32 33 **************** 34 ******** 35 ***** * * 36 ******************************* 37***************************** 38 **************************** 223 ******************************* 224 *************************** 225 ***************************** 226 **************************** 227 ********************************* 228 ************************** 229 **** 230 ********************************* 231 **** 232 233 ******************************** 234 ************************** 235 236 **************************** 237*************************** 238 ********************************** 239 ******************************* 248 ******* 241 ****************************** 242 ****************************** 243 ********************************** 244 ************************* 245 ***************************** 246 ***************************** 247 ******************************** 248 *************************** 249 ******* 250 251 ******************************* ***************************** ZGZ ********************************* ESC ******************************** S ****************************** SSZ Max count: 3867 Legend: * = 39 bytes Total:284933 Process returned o (Oxo) execution time:27.664 s Press any key to continue

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

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions

Question

1. Describe the factors that lead to productive conflict

Answered: 1 week ago