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
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
question
Engineering, 04.07.2019 19:10
Afoot bridge is made as a simple deck, 4 m long, with a cross section 2 m (wide) and 20 cm thick, and made of wood. the deck is supported at the two ends. the maximum load allowable on the bridge is 10 tons, provided it is uniformly distributed on the deck. to sense this load, a strain gauge is placed at the center of the bridge and its resistance is monitored. if the sensor has a nominal resistance of 350 s2 and a gauge factor of 3.6, what is the reading of the strain gauge at maximum load? the modulus of elasticity for the wood used in the construction is 10 gpa.
Answers: 2
question
Engineering, 04.07.2019 19:10
A)-in the process of engineering design, explain the contribution of material selection. b)- explain the procedure of synthesis as is employed in engineering design. c)- is there any relationship between ergonomics and engineering design? explain. d)- safety consideration in engineering design includes human, product and the enviroment . explain how safety will be incorporated into the design?
Answers: 3
question
Engineering, 04.07.2019 19:10
An electric kettle is made out of stainless steel, weighs two pounds (when empty) and is equipped with a heating element that consumes 2 kw of electricity. assuming that the water and the kettle are at the same uniform temperature at any moment of time, calculate the shortest possible time to bring 2 quarts of water from room temperature to the onset of boiling
Answers: 2
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, 10.03.2020 17:02
Questions on the website: 13722361