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, 03.07.2019 15:10
If you were designing a bumper for a car, would you prefer it to exhibit elastic or plastic deformation? why? consider the functions of a bumper in both a minor "fender-bender" and a major collision.
Answers: 1
question
Engineering, 04.07.2019 08:10
Which of the following is an easy way to remember the modified “x” tire rotation? a. nondrive wheels straight, cross the drive wheels b. drive wheels straight, cross the nondrive wheels c. drive wheels crossed, nondrive wheels straight d. drive wheels crossed, nondrive wheels crossed
Answers: 1
question
Engineering, 04.07.2019 18:10
For the closed feedwater heater below, feedwater enters state 3 at a pressure of 2000 psia and temperature of 420 °f at a rate of ix10 ibhr. the feedwat extracted steam enters state 1 at a pressure of 1000 psia and enthalpy of 1500 btu/lbm. the extracted er leaves at an enthalpy of 528.7 btu/lbm steam leaves as a saturated liquid. (16) a) determine the mass flow rate of the extraction steam used to heat the feedwater (10) b) determine the terminal temperature difference of the closed feedwater heater
Answers: 3
question
Engineering, 04.07.2019 19:10
In general, how do thermosetting plastics compare to thermoplastics in mechanical and physical properties?
Answers: 3
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.07.2019 18:30
question
Mathematics, 10.07.2019 18:30
question
Biology, 10.07.2019 18:30
question
Mathematics, 10.07.2019 18:30
question
Mathematics, 10.07.2019 18:30
question
English, 10.07.2019 18:30
Questions on the website: 13722367