Please select a subject first
Advertisements
Advertisements
The ability of an object to take many forms is known as ______.
Concept: undefined >> undefined
Design a class NumDude to check if a given number is a Dudeney number or not. (A Dudency number is a positive integer that is a perfect cube, such that the sum of its digits is equal to the cube root of the number.)
Example 5832 = (5 + 8 + 3 +2)3 = (18)3 = 5832
Some of the members of the class are given below:
| Class name | unique |
| Data member/instance variable: | |
| num | to store a positive integer number |
| Methods/Member functions: | |
| NumDude() | default constructor to initialise the data member with a legal initial value |
| void input() | to accept a positive integer number |
| int sumDigits(int x) | returns the sum of the digits of number 'x' using recursive technique |
| void isDude() | checks whether the given number is a Dudeney number by invoking the function sumDigits() and displays the result with an appropriate message. |
Specify the class NumDude giving details of the constructor ( ), void input( ), intsumDigits(int) and void is Dude(). Define a main() function to create an object and call the functions accordingly to enable the task.
Concept: undefined >> undefined
Advertisements
A class Trans is defined to find the transpose of a square matrix. A transpose of a matrix is obtained by interchanging the elements of the rows and columns.
Example: If size of the matrix = 3, then
| ORIGINAL | ||
| 11 | 5 | 7 |
| 8 | 13 | 9 |
| 1 | 6 | 20 |
| TRANSPOSE | ||
| 11 | 8 | 1 |
| 5 | 13 | 6 |
| 7 | 9 | 20 |
Some of the member of the class are given below:
| Class name | Trans |
| Data members/instance variables: | |
| arr[ ] [ ] | to store integers in the matrix |
| m | integer to store the size of the matrix |
| Methods/Member functions: | |
| Trans(int mm) | parameterised constructor to initialise the data member m = mm |
| void fillarray( ) | to enter integer elements in the matrix |
| void transpose( ) | to create the transpose of the given matrix |
| void display( ) | displays the original matrix and the transposed matrix by invoking the method transpose( ) |
Specify the class Trans giving details of the constructor( ), void fillarray( ), void transpose( ) and void display( ). Define a main ( ) function to create an object and call the functions accordingly to enable the task.
Concept: undefined >> undefined
If (~p ⇒ ~q), then its contrapositive will be ______.
Concept: undefined >> undefined
The dual of (X' + 1) · (Y' + 0) = Y' is ______.
Concept: undefined >> undefined
The reduced expression of the Boolean function F(P, Q) = P' · + P · Q is ______.
Concept: undefined >> undefined
With reference to the code given below, answer the questions that follow along with dry run/working.boolean num(int x)
{ int a=1}
for (int c=x; c>0; c/<10}
a*=10;
return (x*x%a)=x;
}
- What will the function num() return when the value of x = 25?
- What is the method num() performing?
Concept: undefined >> undefined
According to the Principle of duality, the Boolean equation
(A+ B') • (A+ 1) =A+ B' will be equivalent to ______.
Concept: undefined >> undefined
Verify if the following proposition is a Tautology, Contradiction or Contingency using a truth table.
((A => B)^(B => C))=>(A => C)
Concept: undefined >> undefined
Find the complement of the following expression and reduce it by using Boolean laws.
P•( 13 ± Q)•Q•(Q+R')
Concept: undefined >> undefined
How is a decoder different from a multiplexer?
Concept: undefined >> undefined
According to the Principle of duality, the Boolean equation (Aꞌ + B) • (1 + B) = Aꞌ + B will be equivalent to ______.
Concept: undefined >> undefined
Distributive law states that ______.
Concept: undefined >> undefined
According to De Morgan's law (a +b + c')' will be equal to ______.
Concept: undefined >> undefined
From the logic diagram given below, write the Boolean expression for (1) and (2). Also, derive the Boolean expression (F) and simplify it.

Concept: undefined >> undefined
The compliment of the Boolean expression Aꞌ • (B • Cꞌ + Bꞌ • C).
Concept: undefined >> undefined
Convert the following cardinal expression to its canonical form:
F(P, Q, R) = π(0, 1, 3, 4).
Concept: undefined >> undefined
Write the canonical SOP expression for F (A, B) = A <=> B.
Concept: undefined >> undefined
To be recruited as the Principal in a renowned College, a candidate must satisfy any one of the following criteria:
- The candidate must be a Postgraduate and should either possess a B.Ed. degree or a teaching experience of more than 15 years?
OR - The candidate must be an employee of the same college with a teaching experience of more than 15 years.
OR - The candidate must be a Postgraduate but not an employee of the same college and should have a teaching experience of more than 15 years.
The inputs are:
| INPUTS | |
| P | Candidate is a Postgraduate |
| S | Candidate is an employee of the same College |
| E | Candidate has a teaching experience of more than 15 years |
| B | Candidate possesses a B.Ed. degree |
(In all the above cases, 1 indicates yes and 0 indicates no)
Output: X - Denotes eligibility of a candidate [1 indicates eligibility and 0 indicates ineligibility in all cases]
Draw the truth table for the inputs and outputs given above and write the SOP expression for X (P, S, E, B).
Concept: undefined >> undefined
Write the cardinal form of the maxterm X + Y' + Z.
Concept: undefined >> undefined
