quiz حل الأسئلة الجامعية manage_search الأرشيف

تم الحل ✓
categoryبرمجة وتطوير البرمجيات schoolبكالوريوس event_available2026-07-15

السؤال

Transcribed Image Text:

1. In C++, variables that store floating point numbers are declared as either float or double. a. Describe floating point numbers. (3 marks) b. Explain the difference(s) between float or double data types. (2 marks) c. Let x be the first TWO digits of your matric number (group leader), y be the last TWO digits of your matric number, and define z as x. y If the first digit of y is o, replace it with 7. Example: Suppose your matric number is 2013104. Thus, x = 20, y =74 and z = 20.74 Determine the IEEE-754 Single Precision Floating-Point Numbers of decimal value x. y. Explain each step. 2. Given a compound proposition: a. Construct a truth table for the compound proposition (5 marks) ~(~p Aq) V (~p ^ ~q)) V (p ^ q) = p (4 marks) b. Using equivalence law theorems, verify the logical equivalence. Supply a reason for each step (State which law is used at each step). c. Determine if the compound proposition is tautology, contradiction or contingency. (1 mark) (5 marks) Activat Go to PC 3. Suppose R denotes set of all real numbers Z denotes set of all integers Z+ denotes set of all positive integers A = {x € Z+ - a< x <b} B {x ER a≤ x <b} C = {x ∈ Z|-a<x<b} Let a be the THIRD digit and b be the LARGEST digit of your (group leader) matric number. If a = o, change to 3, if a = 1, change to 4, if a = 2, change to 5, other values of a, remain unchanged. Example: Suppose my matric number is 1950123. Then, a = 5 and b = 9 a. State the values of a and b. (1 mark) b. Using Set-builder/Roster notations, list the elements of each of the following sets i. A = (1 mark) ii. B = iii. C = iv. AUC = V. AB = (1 mark) (1 mark) (2 marks) (2 marks) vi. BC = (2 marks) vii. B-A = (3 marks) 4. Consider the linear recurrence relations of degrees one and two, defined by the form İ. an = C₁an-1 ii. anc₁an-1 + C₂an-21 respectively, for n ≥ 2. In case i), the solution (sequence) {a} depends on the two parameters: coefficient c₁ and initial value a₁, denoted here by (c₁, a₁). In case ii), there are the additional coefficient c, and initial value a, so that (c₁, a₁) enlarges to (c₁, C₂, ao, a₁).| a) Recurrence Relation i): Discuss the dependence of sequence {a} on (c₁, a₁) and categorize its sequential behavior into several patterns through programming and visualization of {a}. (7.5 marks) b) Recurrence Relation ii): Do the same as a) with (c₁, C₁, ao, a₁). Programming-The following function may be useful: double LinearRecurrence (double a[DEGREE], double c[DEGREE]), (7.5 marks) where arguments a[] and c[ ] stand for (an-1, an-2, ..., an-DEGREE) and (C₁, C2, ..., CDEGREE), respectively, and DEGREE is the named constant to indicate the degree. This function returns an. Visualization-Use the line plot to see sequence {a} on a graph (horizontal axis: n, vertical axis: an). 5. A Graph is non-linear data structure consisting vertices (nodes) and edges. a. Draw an undirected graph connecting at least 5 nodes containing Euler path. Also assign and show a random number as the weight for each edge in the graph. (4 marks) b. Write the sequence of edges representing the Euler path. c. Produce a matrix that represents the graph drawn in (a) (2 marks) (2 marks) d. Illustrate each step for finding the minimum spanning tree of graph drawn in (a) using the Kruskal's algorithm. (2 marks) Activate Windows e. Describe "minimum spanning tree" in general (2 marks) Go to PC settings to activate Windows.

check_circle الجواب — حل مفصل خطوة بخطوة

hourglass_top