Answer fast and correct

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
Answer fast and correct this time else will give downvote
1:
Write a program that does the following:
Reads from a file 10 integers (one per line) - file
name Integers.dat
Squares each of the integers.
Adds the 10 integers together
Adds the squares of the integers together
Writes each of the integers and its sum into a file called
'SumofSquares.dat'
The last line of the file should contain the total of all the integers
and the total of all of the squares of all of the integers.
Example of the input file (use any integers you prefer):
12
4
223
93 76
a, = 12
54
90
67
543
Example of the output file:
144
16
49729
5776
2916
8100
4489
294849
6.
Integer total =
Squares total =
1073
366029
Transcribed Image Text:1: Write a program that does the following: Reads from a file 10 integers (one per line) - file name Integers.dat Squares each of the integers. Adds the 10 integers together Adds the squares of the integers together Writes each of the integers and its sum into a file called 'SumofSquares.dat' The last line of the file should contain the total of all the integers and the total of all of the squares of all of the integers. Example of the input file (use any integers you prefer): 12 4 223 93 76 a, = 12 54 90 67 543 Example of the output file: 144 16 49729 5776 2916 8100 4489 294849 6. Integer total = Squares total = 1073 366029
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Graphical User Interface
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education