QUESTION one – 20 MARKS
a. With the aid of diagrams, describe the four program execution control structures found in traditional imperative languages. (8 Marks) b. Explain each of the use of the following jump statements as used in the imperative C language. (3 Marks) i. Goto ii. Break iii. Continue
4
c. Study the program below and answer the question that follow: class B { private: int x, wx; void Fxwx (void) public: int y; void Fy (void); voidshowData (void); void getData (void); protected: int z; void Fz (void) };
i. State the number of data members in class B. (1 Mark) ii. State the number of member functions in class B. (1 Mark) iii. Write in its simplest form: ? Default constructor to class B (1 Mark) ? Default destructor to class B (1 Mark) iv. The header of class DD is as shown below: class DD : B { …….};
Complete the table below by explaining the status of inherited member data/function in class DD (5 Marks)
Inherited Member Data/Function
Explanation of Status of Inherited Member Data/Function in Class DD i wx ii Fxwx() iii y iv getData( ) v Fz( )
QUESTION two– 20 MARKS
a. State the rules that govern the formulation of well formed formulae. (5 Marks) b. Explain the term “executing programs” as used in logic programming (1 Mark) c. State the components that identify a calculation in logic programming. (3 Marks) d. Construct a resolution tree to depict the implementation of Forward Resolution Algorithm for the following scenario. (6 Marks)
Basic Facts: B11(x) Database: {1, 2, 3, 4} B12(x) Database: {3, 4, 5, 6} B21(x) Database: {1, 2, 3, 4} B22(x) Database: {1, 2, 3, 5} Rules of Inference: P(x) :=P1(x) P2(x) P1(x) :=B11(x) & P12(x) P2(x) : =B21(x) & B22(x)
e. Compare and contrast the major programming paradigms by completing the following table. (8 Marks) Paradigm Key Concept Program Program Execution Result Imperative Functional Logic Object-Oriented
For a custom-written paper on the above topic, place your order now!
What We Offer
• On-time delivery guarantee
• PhD-level professionals
• Automatic plagiarism check
• 100% money-back guarantee
• 100% Privacy and Confidentiality
• High Quality custom-written papers