CSC231 Homework 8 2017

From dftwiki3
Revision as of 14:48, 14 April 2017 by Thiebaut (talk | contribs) (Created page with "<center> <font size="+2">Page under construction!</font> </center> <P> <center> 300px </center> <br /> <br /> <br /> =Problem #1: Programming in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Page under construction!

UnderConstruction.jpg




Problem #1: Programming in C


Write a C program that starts with 3 DNA strings, one called marker1, one called marker2 and one called DNA, and which zaps the bases (characters) in DNA that sit between marker1 and marker2, replacing them with dashes.
Here are some examples of how the solution program operates:

231b@aurora ~ $ ./hw8_1 AGC ACC ACCGGGGGAGCCAAAGCTTTTTACCTT
ACCGGGGGAGC--------------TT

231b@aurora ~ $ ./hw8_1 AGCA ACC ACCGGGGGAGCCAAAGCTTTTTACCTT
ACCGGGGGAGCCAAAGCTTTTTACCTT
231b@aurora ~ $ ./hw8_1 AGC AT ACCGGGGGAGCCAAAGCTTTTTACCTT
ACCGGGGGAGCCAAAGCTTTTTACCTT
231b@aurora ~ $ ./hw8_1 AC TG ACACACACGGGGGGTGTGTGTG
AC--------------TGTGTG
231b@aurora ~ $  ./hw8_1 AC TG TGACACACACGGGGGGTGTGTGTG
TGAC--------------TGTGTG


Notes
When the first or second markers are not found in the DNA, the program outputs the original DNA string.
When the first marker appears several time, the first occurrence is the one used.
When the second marker appears several times, its first occurrence after an occurrence of the first marker is used.