Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Write Program Read Integers File Print Many Numbers File Average Create Following Text Fi Q35585932

I am new to coding and i’m very confused on this problem. pleasehelp! c++

You are to write a program to read integers from a file and print out how many numbers were in the file and the average of th

You are to write a program to read integers from a file and print out how many numbers were in the file and the average of them. Create the following text files. Text File: data1.text (take note-there is an empty blank line at the end 45 84 75 56 78 15 28 71-5 45 Text File: data2.text (take note there is an empty blank line at the end -40 90 -19 36 82 26 -79 39 -52-42 54 62 -9 99 -37 9-99 -85 52 31 57-64 0-88 41 59-94 73 97-37 55 7472 34-40 83 7 15-72 53-65 13 65 14-76 5 -100 56 39-60 47 47 100 19 -21 46 -11 96-28 28 48 -84 -48-7 97 -35-27-6 Text File: data3.text (take note-there is nothing in the file Output #1 Enter the filename: datal.txt The numbers are: 45 84 75 56 78 15 28 71 -5 45 There were 10 numbers in the file The average was 49.20 Output #2 Enter the filename: data2.txt The numbers are: -40 90 -19 36 82 26 -79 39-52 -42 54 62-9 99-37 9-99-85 52 31-57-64 0-88 41 59-94 73 97-37 55 -74 -72 -34 -40 83 7 15 -72 53 -65 13 65 14-76 5-100 56 39-60 47 47 100 19 -21 46 -11 96 -28 28 48 -84 -48-7 97-35 -27-6 There were 68 numbers in the file The average was 1.78 We were unable to transcribe this imageShow transcribed image text You are to write a program to read integers from a file and print out how many numbers were in the file and the average of them. Create the following text files. Text File: data1.text (take note-there is an empty blank line at the end 45 84 75 56 78 15 28 71-5 45 Text File: data2.text (take note there is an empty blank line at the end -40 90 -19 36 82 26 -79 39 -52-42 54 62 -9 99 -37 9-99 -85 52 31 57-64 0-88 41 59-94 73 97-37 55 7472 34-40 83 7 15-72 53-65 13 65 14-76 5 -100 56 39-60 47 47 100 19 -21 46 -11 96-28 28 48 -84 -48-7 97 -35-27-6 Text File: data3.text (take note-there is nothing in the file Output #1 Enter the filename: datal.txt The numbers are: 45 84 75 56 78 15 28 71 -5 45 There were 10 numbers in the file The average was 49.20 Output #2 Enter the filename: data2.txt The numbers are: -40 90 -19 36 82 26 -79 39-52 -42 54 62-9 99-37 9-99-85 52 31-57-64 0-88 41 59-94 73 97-37 55 -74 -72 -34 -40 83 7 15 -72 53 -65 13 65 14-76 5-100 56 39-60 47 47 100 19 -21 46 -11 96 -28 28 48 -84 -48-7 97-35 -27-6 There were 68 numbers in the file The average was 1.78

Leave a Reply

Your email address will not be published. Required fields are marked *