Having some trouble with a couple parts of a programming assignment I was given.
ID: 3781834 • Letter: H
Question
Having some trouble with a couple parts of a programming assignment I was given. All three parts involve reading a file that was given to us and displaying what's in the file in different ways. **This is in C++**
1. Read the list of integers in the supplied "numbers.dat" file and
* display the smallest and largest value in the file. Do not modify
* the file. It is safe to assume that the file contains no more
* than 100 values.
2. Read the integer values in the file "numbers.dat" and display
* them in reverse order (that is, display the last number in the
* file first, the second-to-last second and so on). Use an array to
* store the values. It is safe to assume that the file contains no
* more than 100 values.
3. Read the integer values in the file "numbers.dat" and use a for
* loop to display the items in order, separated by a comma and a
* space. The output should resemble:
*
* 10,9,-2346,123,...,95,26
*
* Note: There is no comma after the last number. It is safe to
* assume that the file contains no more than 100 values.
Appreciate any help! I suck at reading/writing files!
Explanation / Answer
okay.I got your question.As you have already did some part I will give the explanation but not the code so that it will help you more
1)
Method to find the value:
2)
it will print all the numbers in reverse order
3)
Hope,my answer helped you.It's just a theorytical one.Try it.And,if you need the code if the theory is not enough then please feel free to ask us.We will love to help you
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.