i. Add a function named readfile() to your program that takes a string (filename) as the parameter. You can assume that this file contains two strings on separate lines. Your function must read the file and return these two strings. ii. Add a function named assemble() that takes two string parameters (e.g., x and y). You can assume that x and y have same length. This function must create a string (e.g., z) by concatenating characters in x and y in the alternating order. That is, if x = "aceg" and y = "bdfh" then z must be abcdefgh. Your function must return z. iii. Add a function named writefile() to your program that takes two strings as parameters, a filename and one assembled string (e.g., z), in this order. Your function must write the string z in this file. This function does not return anything.
Oh no! Our experts couldn't answer your question.
Don't worry! We won't leave you hanging. Plus, we're giving you back one question for the inconvenience.
i. Add a function named readfile() to your program that takes a string (filename) as the parameter. You can assume that this file contains two strings on separate lines. Your function must read the file and return these two strings.
ii. Add a function named assemble() that takes two string parameters (e.g., x and y). You can assume that x and y have same length. This function must create a string (e.g., z) by concatenating characters in x and y in the alternating order. That is, if x = "aceg" and y = "bdfh" then z must be abcdefgh. Your function must return z.
iii. Add a function named writefile() to your program that takes two strings as parameters, a filename and one assembled string (e.g., z), in this order. Your function must write the string z in this file. This function does not return anything.