Question: Part A Write a program to create a file named hw12.txt if the file does not exist (If the file exists, terminate your program without

 Part A Write a program to create a file named hw12.txt

Part A Write a program to create a file named hw12.txt if the file does not exist (If the file exists, terminate your program without doing anything.) Write ten integers ranging [0, 99] created randomly into the file using text IO. Integers are separated by spaces in the file. Read the data back from the file and display them on the console Part B In the same program, create a file named hw12 scale.txt if it does not exist (If the file exists, terminate your program without doing anything.). Multiply all the numbers from hw12.txt by 10 and save all the new numbers in hw12 scale.txt. For example, ifhw12.txt is 26 . 12 89 54 65 12 65 74 Then hw12 scale.txt should be: 260 40 890 540 120 650 740 30

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!