Answered step by step
Verified Expert Solution
Question
1 Approved Answer
random_numbers.txt (2.186 KB) 86 27 63 73 61 88 12 64 49 18 98 43 48 56 15 57 58 75 79 45 16 91
random_numbers.txt (2.186 KB)
86 27 63 73 61 88 12 64 49 18 98 43 48 56 15 57 58 75 79 45 16 91 91 39 56 38 78 68 21 97 46 83 91 70 5 39 9 32 18 43 10 53 94 15 96 79 26 11 15 35 1 82 91 33 43 49 77 93 4 45 78 24 13 25 87 13 34 68 15 94 70 54 76 96 83 26 63 74 42 9 100 25 48 33 95 41 20 90 89 57 21 96 19 11 24 30 98 36 54 9 100 98 57 41 14 52 48 94 16 64 51 13 87 25 94 21 13 95 18 10 16 97 23 67 41 24 55 19 39 91 46 4 43 3 50 89 59 96 22 61 81 88 60 85 13 48 28 21 6 3 84 72 69 6 70 55 26 48 92 34 99 33 10 65 51 97 19 28 43 60 56 72 20 91 19 80 26 90 9 34 49 3 22 72 58 100 4 63 46 34 22 83 2 77 55 64 24 49 71 87 11 82 35 66 36 45 44 63 40 95 11 54 50 63 77 61 32 52 32 46 69 83 55 90 98 56 77 13 84 4 10 57 85 27 10 16 10 48 28 74 35 88 71 81 68 93 52 91 88 32 68 70 28 31 58 63 58 18 72 81 6 69 17 53 82 48 36 8 72 26 50 58 79 99 30 42 45 56 3 63 99 21 41 23 41 34 99 94 47 59 63 85 85 24 78 84 97 43 34 10 52 15 46 9 49 96 26 10 76 48 88 5 97 56 67 66 74 97 37 87 47 34 46 15 75 33 5 71 35 96 31 95 61 42 25 17 81 75 20 16 22 47 67 100 2 26 33 20 7 1 98 46 56 14 47 76 87 62 50 81 56 98 79 72 4 80 93 84 78 72 19 13 51 88 27 66 89 8 31 29 9 60 97 85 26 100 53 44 57 87 72 83 9 45 98 60 99 78 98 11 89 25 43 31 76 36 38 38 18 8 92 43 3 60 8 95 36 61 58 53 86 86 40 71 95 4 95 84 84 50 96 15 13 24 5 73 51 68 62 34 6 88 56 75 63 72 41 64 35 27 29 23 34 54 80 61 55 83 92 67 1 92 2 17 32 25 59 84 24 69 56 2 57 11 43 86 32 92 83 52 76 63 87 13 4 61 62 55 7 38 98 73 40 1 25 66 77 5 82 16 98 34 79 64 83 76 66 42 23 47 84 48 79 13 25 47 24 52 57 70 3 48 87 16 56 10 58 3 19 95 82 27 20 53 1 44 39 26 45 97 82 26 25 50 30 93 43 22 88 59 18 39 84 77 34 12 61 92 63 99 9 44 82 74 36 54 21 93 64 23 19 72 61 61 70 38 87 86 32 15 1 70 72 43 88 79 48 71 1 74 45 54 37 88 48 34 84 16 22 94 58 56 41 20 53 36 30 18 28 96 42 97 28 38 100 44 1 65 98 65 11 83 46 99 81 25 59 72 95 51 27 57 15 73 24 96 46 22 15 96 35 70 57 81 3 19 61 50 38 59 52 87 46 10 14 48 74 7 29 97 30 93 39 47 70 42 16 70 34 74 97 1 81 83 90 37 56 74 32 67 12 61 65 97 38 19 10 29 28 41 4 91 5 14 63 33 99 36 57 17 100 99 35 14 100 67 63 67 78 80 99 11 25 51 78 56 81 40 5 27 58 93 73 98 65 66 68 43 33 97 21 36 5 48 16 51Attached Files:random_ numbers.txt (2.186 KB) Create a new file (in Dev C++) Write a program to count, sum, and average numbers from a file: .Header comments must be present Initialize count and sum to zero Use the file "random_numbers.txt" generated in Homework 4.1 Check that the file is open before reading from it .Read each number from the file, adding it to the sum and incrementing the count Close file when all numbers have been read Calculate and display the count, sum, and average of the numbers (average should be displayed to 2 decimal places) Use comments and good style practices . A sample romnumbers.txt"is provided if Homework 4.1 has not been completed yet. SAMPLE OUTPUT: There are 736 numbers in the fiie The sum is 37989 and the average is 51.62
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started