Prog rogram thất reads int spe ta, produces (create) ne creen accordingly. -45 92 84 0 10 O 32 0 -12 -11

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section8.4: File Streams As Function Arguments
Problem 3E
icon
Related questions
Topic Video
Question
Use files in python program please don’t use functions to solve it.
Exercise 3:
Write a Program that reads integers from a file called "input.dat" (Figure 1) that contains unknown number
of data, produces (create) new file that contains the data shown in Figure 2. The data must be displayed
on screen accordingly.
71 -45 92 84 0 10
====== ====== ======================================
12 0 32 0 -12 -11
The input data has
9 19 5 3 69 -10
24 positive numbers
5 negative numbers
93 21 25 53 20 12
89 55 -13 28 29 17
and 3 zeros.
Figure 1. Sample “input.dat"
The average of positive numbers is = 37.64
==================================================
Figure 2. Sample screen output
Transcribed Image Text:Exercise 3: Write a Program that reads integers from a file called "input.dat" (Figure 1) that contains unknown number of data, produces (create) new file that contains the data shown in Figure 2. The data must be displayed on screen accordingly. 71 -45 92 84 0 10 ====== ====== ====================================== 12 0 32 0 -12 -11 The input data has 9 19 5 3 69 -10 24 positive numbers 5 negative numbers 93 21 25 53 20 12 89 55 -13 28 29 17 and 3 zeros. Figure 1. Sample “input.dat" The average of positive numbers is = 37.64 ================================================== Figure 2. Sample screen output
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr