Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Modify the code below to use a for loop to add all the lines from the file on se

ID: 3811735 • Letter: M

Question

Modify the code below to use a for loop to add all the lines from the file on separate tracks. from earsketch import* init() setTempo(100) file Data = importFile("http://earsketch.gatech.edu/itec2120/data/clipAndMeasures.txt") lines = fileData.split(" ") # replace the code below with a for loop that adds all the lines on separate tracks track = 1 first_line = lines[0] values = first_line.split("; ") clip = values[0] start = int (values[1]) end = int (values [2]) fitMedia(clip, track, start, end) finish()

Explanation / Answer

track = 1;

for(int i=0;i<=n;i++)

{

first_line = line[i];

values = first_line.spl;it(" ; ");

for(int j= 0;j<=values;j++)

{

clip = values[j];

start = int(values[j+1]);

end = int(values[j+2]);

firmedia(clip , track, start, end);

finish();

}

}

for(int k=1;k<=2;k++)

{

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote