Write a function to read every 2nd value from a text file and store it in a vector. Additionally, write a function to read in the vector convert to its absolute value and determine the number of digits in the number for each value in the vector. For example: -100-> 100 = 3 digits. Display the two functions as two separate codes for simplicity.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section: Chapter Questions
Problem 5PP
icon
Related questions
Question
Write a function to read every 2nd value from a text file and store it in a vector. Additionally,
write a function to read in the vector convert to its absolute value and determíne the number of
digits in the number for each value in the vector. For example: -100-> 100 3 digits. Display the
two functions as two separate codes for simplicity.
Note: There are 2 parts (functions) to this question. Please write two separate codes for simplicity.
You can create your own text file with random numbers if you like so that an output can be
generated. The solution must be in C++.
Transcribed Image Text:Write a function to read every 2nd value from a text file and store it in a vector. Additionally, write a function to read in the vector convert to its absolute value and determíne the number of digits in the number for each value in the vector. For example: -100-> 100 3 digits. Display the two functions as two separate codes for simplicity. Note: There are 2 parts (functions) to this question. Please write two separate codes for simplicity. You can create your own text file with random numbers if you like so that an output can be generated. The solution must be in C++.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr