Question
"A boat takes 60 seconds to travel ______ metres
downstream and 40 seconds to travel ______ metres upstream in the same river. The speed of the stream is ______ m/s. Which of the following options will correctly fill the blanks in the same order to make the statement true?" I. 1440, 720, and 3 II. 1500, 600, and 5 III. 1200, 560, and 4Solution
ATQ, Let speed of boat in still water and speed of stream be, 'b' m/s and 's' m/s, respectively. For statement-I: Downstream speed of boat = b + s = (1440/60) So, b + s = 24 .... (i) Upstream speed of boat = b - s = (720/40) So, b - s = 18 .... (ii) Subtract equation (ii) from equation (i) , we get, b + s - b + s = 24 - 18 Or, 2s = 6 So, s = (6/2) = 3 Speed of stream = s = 3 m/s So, data given in statement-I is true. For statement-II: Downstream speed of boat = b + s = (1500/60) So, b + s = 25 .... (i) Upstream speed of boat = b - s = (600/40) So, b - s = 15 .... (ii) Subtract equation (ii) from equation (i), we get, b + s - b + s = 25 - 15 Or, 2s = 10 So, s = (10/2) = 5 Speed of stream = s = 5 m/s So, data given in statement-II is true. For statement-III: Downstream speed of boat = b + s = (1200/60) So, b + s = 20 .... (i) Upstream speed of boat = b - s = (560/40) So, b - s = 14 .... (ii) Subtract equation (ii) from equation (i) , we get, b + s - b + s = 20 - 14 Or, 2s = 6 So, s = (6/2) = 3 Speed of stream = s = 3 m/s ≠4 m/s So, data given in statement-III is false. Therefore, data given in both statement-I and statement-II is false
What is the primary output of the lexical analysis phase of a compiler?
What is a primary advantage of generating intermediate code during compilation?
Which parsing method uses a stack and an input buffer?
Which phase of a compiler is responsible for creating a stream of tokens from the input source code?
If an expression `x = a + b` is computed, and later in the same basic block, `y = a + b` is computed, a compiler can apply which optimization?
Which of these is used for resolving operator precedence in parsing?
Which data structure is commonly used in the implementation of recursive descent parsing?
What is the purpose of Normalization in database design? Â Â Â Â Â
Which parsing technique is a top-down parser that cannot handle left recursion and requires the grammar to be free of common prefixes?
A "parser" is primarily responsible for which phase of compilation?