Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

garbageData.txt : You MUST convert any numbers to a string before you can write to a text file Use the str function to do that

image text in transcribed

garbageData.txt :

image text in transcribed

  • You MUST convert any numbers to a string before you can write to a text file
  • Use the str function to do that conversion
  • You cannot write a data structure to a file but you can write individual element but you have to convert them to a string
Assignment #4 - Data Structures and Files Due: Check Blackboard Course Site for Due Date Write a program to do the following: Read the numbers from text file garbageData.txt Store those numbers in an array and output the following statistics: o Sum of all the numbers o The average o The standard deviation For each number in your array, add a different random number that ranges from 1 to 10 AND store that new value in a different array. For example, the first number could have 8 added to it and the second number could have 10 added to it. Output the following statistics for the new array o Sum of all the numbers o The average o The standard deviation Store the values of the new array into a new text file named myOutput.txt. Make sure that numbers are arranged in a grid that is 5 by 5 with a space between each number. You should have 5 lines with 5 numbers on each line. Save the program as a *py file and upload the both the python file and your output file (myOutput.txt) to blackboard.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions