subject
Engineering, 14.12.2019 02:31 liddopiink1

Write a c++ program that will read all the integers from the provided file "numbers. txt" and then save them back to another file "sortednumbers. txt" in a sorted order. your code should load the provided file "numbers. txt". you will need to place this file "numbers. txt" in the same directory as your source. cpp file.

you will need to load all the numbers from the file and save them in an array. sort this array of numbers in ascending order. finally save this newly sorted array of numbers back into another file named "sortednumbers. txt".

your code only needs to work with this file. you can hard code the size of your integer array to 7. for example, int array[7].
expected operation:
numbers. text contents
5-8 7 2 10 4 15
sortednumbers. text contents
-8 2 4 5 7 10 15
hint : you can use any sorting algorithm of your choice in order to sort the loaded numbers
a. selection sort might be simpler
b. merge sort them if you want

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
If a particle moves along a path such that r : (3 sin t) m and ? : 2t rad, where t is in seconds. what is the particle's acceleration in m/s in 4 seconds? a)- 16.43 b)- 16.29 c)- 15.21 d)- 13.79
Answers: 1
question
Engineering, 04.07.2019 18:10
Coiled springs ought to be very strong and stiff. si3n4 is a strong, stiff material. would you select this material for a spring? explain.
Answers: 2
question
Engineering, 04.07.2019 18:10
Aplate clutch has a single pair of mating friction surfaces 250-mm od by 175-mm id. the mean value of the coefficient of friction is 0.30, and the actuating force is 4 kn. a) find the maximum pressure and the torque capacity using the uniform-wear model. b) find the maximum pressure and the torque capacity using the uniform-pressure model.
Answers: 3
question
Engineering, 04.07.2019 18:10
The drive force for diffusion is 7 fick's first law can be used to solve the non-steady state diffusion. a)-true b)-false
Answers: 1
You know the right answer?
Write a c++ program that will read all the integers from the provided file "numbers. txt" and then s...
Questions
question
Mathematics, 05.01.2021 22:30
question
Computers and Technology, 05.01.2021 22:30
question
Health, 05.01.2021 22:30
question
English, 05.01.2021 22:30
question
Spanish, 05.01.2021 22:30
question
English, 05.01.2021 22:30
question
Spanish, 05.01.2021 22:30