1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
faltersainse [42]
2 years ago
15

Counting the character occurrences in a file

Computers and Technology
1 answer:
Katena32 [7]2 years ago
5 0

Answer:

hope this helps!

Explanation:

#include <iostream>

#include <fstream>

using namespace std;

void print_histogram(int counter[26])

{

   for(int i = 0; i < 26; ++i){

       cout << (char)(i+97) << " ";

       for(int j = 0; j < counter[i]; ++j){

           cout << (char)254;

       }

       cout << endl;

   }

}

int main()

{

   int counter[26] = {0};

   string filename = "data.txt";

   char byte = 0;

   // opens file in read mode

   ifstream input_file(filename);

   if (!input_file.is_open()) {

       cerr << "Could not open the file - '"

            << filename << "'" << endl;

       return EXIT_FAILURE; // exit if not opened

   }

   // reads every character from the file

   while(input_file.get(byte)){

       if(byte >= 97 && byte <= 122){

           ++counter[byte-97];

       }

   }

   print_histogram(counter); // required print histogram function

   return 0;

}

You might be interested in
On a client/server network, data does not necessarily follow the same path between the request (client) and the response (server
Andrej [43]

Answer:

SSL and HTTPS play a factor

6 0
2 years ago
Supervisor: You will need to consolidate your trouble tickets
liubo4ka [24]
Wheres the rest???????????????????
7 0
2 years ago
Which of the following is a basic principle of improvement?
lesya [120]

From the given the statement, "every system is perfectly designed to get the results it gets" is a basic principle of improvement.

Option B

<u>Explanation:</u>

The improvement activity begins with the quote ‘every system is perfectly designed to get the results it gets’, by W. Edwards Deming; The quote states both the unintended and intended effects are designed into our systems.

For example: Healthcare in the UK has been perfectly designed to lower the waiting times to 18 weeks for various procedures over last twelve years. Reflecting on Safer Patients Initiative (SPI), this can be true to improvement systems: every improvement system is perfectly designed to get the results its gets and SPI is a case in point.

The leading improvements that need to be designed into our improvement systems:

  • Improvement activity needs to be built on strong foundations
  • Greater engagement with people’s intrinsic motivation
  • Embrace a wider set of methods
  • Greater understanding of how systems and processes outside direct clinical care contribute to safety and quality.

So, it can be concluded that the line given by W. Edwards Deming tends to be the principle of improvement.

6 0
3 years ago
A user wants to visualize a highly complex 3D model using a Virtual Reality headset.
Lyrx [107]

The best way for an end user to visualize a highly complex 3D model using a Virtual Reality headset is to: A) use any headset and increase the bandwidth of the Wi-Fi connection.

<h3>What is Virtual Reality (VR)?</h3>

Virtual Reality (VR) can be defined as a computer technology through which virtual images of any physical environment (realities) and human-machine interactions are displayed, especially through the use of various computer technologies and wearables.

<h3>The elements of Virtual Reality (VR).</h3>

Some of the elements of Virtual Reality (VR) include the following:

  • Life interaction
  • Self projection
  • Telexistence
  • 3D space or model.

In this context, we can infer and logically deduce that Virtual reality is a  computer technology which is designed and developed to simulate a three-dimensional (3D) environment through which end users can explore and interact.

In conclusion, the best way for an end user to visualize a highly complex three-dimensional (3D) model using a Virtual Reality headset is to use any headset and increase the bandwidth of the Wi-Fi connection.

Read more on Virtual Reality here: brainly.com/question/26705841

#SPJ1

6 0
1 year ago
So this is not exactly a question but I can’t find the answer anywhere else. Also if you answer this, please do, I will give you
elena55 [62]

Answer: Well, in transit means "in the process of being transported" according to Merriam Webster, so I would think that would mean that it is being shipped from China over to America (Or wherever you may live) currently. Hope this helped!

Explanation:

6 0
3 years ago
Other questions:
  • When you are printing handouts, which of these can you do? A. Save paper by placing more than one slide per page. B. Check the f
    7·1 answer
  • how to make assignment on power point plz cntct me and help me all about power point and my assignment is prime ministers of pak
    13·1 answer
  • Which of the following could not be represented by columns in the SPSS data editor? a. Levels of between-group variables. b. Lev
    11·2 answers
  • Egyptian hieroglyphs were part of a writing system used by the ancient Egyptians. What type of graphic design elements did they
    13·1 answer
  • ​open-source software is​ ________.
    11·1 answer
  • What is the difference between word processing software and email?
    12·2 answers
  • Which of the following scenarios is an example of irrelevant media?
    11·1 answer
  • Which of the following statements are true regarding models? Select 3 options.
    11·1 answer
  • For the sake of maximizing hardware utilization in a multicore system with a many to many threading model, the relationship of t
    12·1 answer
  • PLZZZZZZZZZZ HELP ME OUT THIS DUE TODAY AND NEED SOMEONE HELP!!!!!plzzzzzzzzzzz i begging you!!!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!