Question: Review the C++ string class and use it in this program. Use member functions of the stringclass to process strings. For example, to search for
Review the C++ string class and use it in this program. Use member functions of the stringclass to process strings. For example, to search for a substring in a string, you can use thestring member function find().b) In /proc/cpuinfo, the majority of the input fields repeat for each processor. Processornumbers need not be contiguous, so you need to count the number of processors. On turing, eachprocessor block in the /proc/cpuinfo corresponds to a CPU core. A physical chip can havemultiple cores. A host such as turing can have several physical multi-core chips.c) For /proc/cpuinfo, you need to read the file, save the fields you need, and then formatyour output.You do not know which order the blocks will come in, and you do not assume the order of thekeywords within the block except the first line is "processor: #". For example, do not assume thekeyword "Physical id" is the 10th line of the file. Instead, you need to read line by line and checkif the keyword in a line matches the keyword you are looking for. To get the total number ofphysical multi-core chips, you must keep track of the content of "physical id" fields (instead ofonly reading the last block
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
