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
The temperature of air decreases as it is compressed by an adiabatic compressor. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:10
Different types of steels contain different elements that alter the characteristics of the steel. for each of the following elements, explain what the element does when alloyed with steel.
Answers: 2
question
Engineering, 04.07.2019 18:10
The filament of an incandescent lamp has a temperature of 2000k. calculate the fraction of radiation emitted in the visible light band if the filament is approximated as blackbody
Answers: 2
question
Engineering, 04.07.2019 18:20
Steam enters a converging nozzle at 3.0 mpa and 500°c with a at 1.8 mpa. for a nozzle exit area of 32 cm2, determine the exit velocity, mass flow rate, and exit mach number if the nozzle: negligible velocity, and it exits (a) is isentropic (b) has an efficiency of 94 percent
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
Physics, 28.06.2019 23:00
question
Physics, 28.06.2019 23:00
Questions on the website: 13722361