Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING ONLY SYS and MATH MODULES please Your program must take command line arguments an input filename and an output filename. 2. You can import

USING ONLY SYS and MATH MODULES please

Your program must take command line arguments an input filename and an output filename. 2. You can import the sys and math modules but no others. 3. Sample input data for your program is provided in the accompanying file (assignment1_input.txt) which is a plain text file. Where appropriate, fields are separated by tabs (eg for problem 1, two integers are provided separated by a tab character). Long strings are provided on a single line even if that line is wrapped over several lines ie there are no newline characters in the string. 4. You must implement a separate function within your program for each of the problems. 5. The functions must return the result of the computation and not write the result to file. 6. Your solution should be written as a module so it must have a main() function which contains the 'driver' code ie read input and write output, prepare data and call functions. This will also require conditional execution of main(). 7. The results of all problem solutions should be written to a single file (output_assignment1.txt). Each problem answer, which may of course be multiline, should be preceded by a line containing 2 hash (#) marks followed by the name of the problem. For example: ##INI2 Your answer

Your code should be a general solution so it should be able to handle any input file with this format ie the inputs could be in any order so your code DOES NOT count lines to decide which function to call. Your code will be tested with another input file which maintains this format but with different, randomized inputs

Input.txt:

##INI2 997 949 ##INI3 qQLXgmYrUBP3vOHWY8b9aumbUZFsXWKc1OkUERvQ9ncJAlK2T6uWr8BbH0PH9LimnodromusT8yxOGlFJ7qOZCWPJEVSmarcianuspO62TLrhPKzbxBY0QBctFbwrP7BQCMKPqGtQB3bEl9RSxaOF4XwKCic3dQ3dUtYzJBj7voTmBzVAm6pLnLML1x 61 71 92 100 ##RNA GTCCGAACCACTCCGTTTGTCAAGATTCATGGATCGGCGTCTCAATTTGGCTCCGGTTACAAGGCGCCAATCCAGTCCTCATAAAGTGTCTCCGCCACCCCGATGATACTTACTATACGACTCTAATTTGTGGTCGGTCAGACTCCCAAGTGAACTAACCCACGTTGCTGGGTCCAGGTTTGAGTGCCTACTTCACTACTTTAGCTCTTATGTGCCGATTGAGCCCATAATTCTGTCTGAATAAGTGGCTTAAGAGAGGGAGCCTTGGGAGGATCTAGGACTATCTTGCGCTTAATTGTTCGTACTACTTGGCACAGCGAGGTCGTGATTGATCAAGATCCGAATGTGATGGGCACCTAACAGGCGATGTTTCGCACTAACCGAGGCTCCAGGCAGACGGGCCTAGAGGTGGGGCGTCTTTTTATCATGTACACTCTGGCTGTAGACCTTGAATGCGGTGTCAAATGCCCGAGACGAACGCCGGGTCTTTCCATCCTCATAGCCATGGATCCACACATCGGCGGCCTTAATCTCTGACACGTCTCAAACAGAGTTTAAGTTTCGTACGCTTTGCTGTCCTAACCAAAGTACTAGTTCAGACAGTGCTCCACGTGATATGTTATGGACTCACCGCTGATGACATGCTAGTTCGTTCACAGGAGTGTAGCATCTATTGTCACTATTACGTGGCGGAGAGCGCGAGTCATCCTGATGTGAGGAGAGCGCCGACTAGAACCAGCAAGGTATAGCTGAAGTCGTCAAATCCGGCCAGCAAATGGGTTTTCTTACTGCGGGCAACTGGTTGCGCGGGGGCAACAGTTGCTGTCTATTCGTTATATTGATAAAGCCAATCAGACCAACCAAAATCGGGTAATAGACCACCAAAACGCAATTTTGGGGAAGTCACGTGAGTTTGCGGCGCAACATT ##DNA ACCTATTGAGGAGAATTGTGTGTCGATGCTAAAGGCGTTCTCTCATCCCGCTATGTTCAAGACAGATCAGAATAAAAGGACCATACTCTGAGGACGATAGGATTAACATTGTATTCAATATGCAGGATGGTTCACAAATAATCTAGGTCCGACTTAGTGGCTGCTATGGAGTAACTTTACCACGTTGCGTATAGGTTAGTGCAGTAGCTTCGCCTTGGCCGTGCTCCTGTTCTGGTGCGTGAGAACGCCTTATGAAACCAAAGGTTAGCGGTTAACAGAGATGCCTGGTGGGTGCGTACCCTCCTCCGCCTCGATGCAATGGCCCCGCATCATCCACCAAAGCTATTACCCAGAAAACAGGTTGCTAACATGTAACAGAAGGGGCGGTTATGGTGTGCACTAGGTTTTACTCGGTCAGCGAAGAAGCCGCCGGTCAGGAGCTCCCGATAAGGCCCGCCACCAGTTGGAGACAAATTACCAAGAAGGTAGCTTAATTCCTCGAAGAGAATTGGTGCTTACAGGCATACATCAACCGGCGATTGAGTGGGAATATCACCACTAGCATTCCTCGACCTCGATCCGTGGAACCGCACGGTATCTTTTCGAACTCGTACCAGTCTGATTCCATGTAAGCGCGTATTCTGCATGCGGGCCGAAAATGCGGCCCTCCTACGGGTCAGCTGAGCTGAAGACTATCGTCACGAGTGTAGCCCGGTACGGATCACTGGCTACACTCGTCTTCGGCGGACGTCGAAGTCTCAAAGCACTAGAGTTTACCGATCTAGATCGCTTGAGCAGTGAAATGGGGGACCTAGCCAGAAAATATCTGCAAATCCGCAGTACCTAACGCGTCACATCCAG ##INI4 4984 9310 ##INI2 756 834 ##INI6 When I find myself in times of trouble Mother Mary comes to me Speaking words of wisdom let it be And in my hour of darkness she is standing right in front of me Speaking words of wisdom let it be Let it be let it be let it be let it be Whisper words of wisdom let it be And when the broken hearted people living in the world agree There will be an answer let it be For though they may be parted there is still a chance that they will see There will be an answer let it be Let it be let it be let it be let it be There will be an answer let it be Let it be let it be let it be let it be Whisper words of wisdom let it be Let it be let it be let it be let it be Whisper words of wisdom let it be And when the night is cloudy there is still a light that shines on me Shine until tomorrow let it be I wake up to the sound of music Mother Mary comes to me Speaking words of wisdom let it be Let it be let it be let it be yeah let it be There will be an answer let it be Let it be let it be let it be yeah let it be Whisper words of wisdom let it be ##INI4 360 4986 ##INI6 The quick brown fox jumped over the lazy dog dog dog

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

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

5. Our efficiency focus eliminates free time for fresh thinking.

Answered: 1 week ago