MABS Institution
11th Computer Science Monthly Test -1 ( Specification and Abstraction )-Aug 2020
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
If \(\sqrt{2}\) = 1.414, and the square -root() function returns -1.414, does it violate the following specification?
-- square -root (x)
-- inputs: x is a real number, x > 0
-- outputs: y is a real number such that y2=x -
What is a state?
-
Define control flow.
-
What are the basic principles and techniques for designing Algorithms.
-
Define an algorithm.
-
What is abstraction?
-
Write a note on the parts of specification of an algorithm.
-
Name the basic principles and techniques for designing algorithms
-
Write the goal of the algorithm.
-
-
What is the use of abstraction?
-
What is the form and meaning of assignment statement?
-
-
What should we know while designing algorithm.
-
Define state of an algorithm
-
Define the input-output relationship between the designer and user of the algorithm.
-
What does specification of an algorithm consists.
-
Explain the three control flow statement.
-
Explain the specification format.
-
Write the specification of an algorithm hypotenuse whose inputs are the lengths of the two shorter sides of a right angled triangle, and the output is the length of the third side.
-
Explain building blocks of algorithm
-
Exchange the contents: Given two glasses marked A and B. Glass A is full of apple drink and glass B is full of grape drink. For exchanging the contents of glasses A and B, represent the state by suitable variables, and write the specification of the algorithm.
-
Explain in detail how will you construct an algorithm. Whatever with in ( )
-
-
Suppose you want to solve the quadratic equation ax2 + bx + C = 0 by an algorithm. quadratic_solve (a, b, c)
-- inputs: ?
-- outputs: ?
You intend to use the formula and you are prepared to handle only real number roots. Write a suitable specification.
\(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\) -
What are the values of variables m and n after the assignments in line (1) and line (3)?
-
-
Explain Algorithm Design Techniques.
-
Explain the Basic Building Blocks of Algorithms.