Question 7
The following pseudocode is executed using the "Library" dataset. What will count represent at the end of the execution?
1 count = 0 2 while(Table 1 has more rows){ 3 Read the first row X from Table 1 4 Move X to Table 2 5 Flag = True 6 if(X.Genre != "Fiction"){ 7 Flag = False 8 } 9 if(Flag){10 while(Table 1 has more rows){11 Read the first row Y from Table 112 if(X.Author == Y.Author){13 Move Y to Table 214 if(Y.Genre != "Fiction"){15 Flag = False16 }17 }18 else{19 Move Y to Table 320 }21 }22 Move all rows from Table 3 to Table 123 }24 if(Flag){25 count = count + 126 }27 }Number of authors who have written exactly one book under genre "Fiction"
Number of pairs of authors who have not written any book under genre "Fiction"
Number of authors who have written books only under genre "Fiction"
Number of pairs of authors who have written books only under genre "Fiction"