You’re asked to read a file a line at a time. For each line, you have to split it into fields. Which of the following sets of pseudo class definitions is likely to be more orthogonal? code example
Example: You’re asked to read a file a line at a time. For each line, you have to split it into fields. Which of the following sets of pseudo class definitions is likely to be more orthogonal?
class Split1 {
constructor(fileName) # opens the file for reading
def readNextLine() # moves to the next line
def getField(n) # returns the nth field in the current line
}