You are required to create a class for dealing with complex numbers. In this particular
example we are only applying two arithmetic operations over complex number – addition
and subtraction. In complex numbers, we treat the real and imaginary part separately. You
need to define a constant char and assign it ‘i’, indicating the imaginary part. Also declare
two variables for denoting the real part and coefficient of the imaginary part. Define the
appropriate constructors, getters, setters and destructor as per the requirements.
You are required to create an object passing 2 arguments to its constructor, another
constant object with 2 arguments to its constructor. Add them both and store the resultant
object in a third instance by using the concept of copy constructor. Following are the
function prototypes,
Complex()
Complex(int, int)
Complex add(Complex)
void display()
void display() const
Analyze the events leading to the Texas Revolution and its outcome and discuss whether the Texians were justified to seek independence from Mexico. Discuss specific details to support your opinion.
Observe your father daily activities closely for a few days and then write a brief and concise paragraph about his daily routine.you are required to use at least ten sequence markers appropriately to create a both cohesive and coherent paragraph
You are required to create a class by the name of ‘Matrix’. The matrix private domain must
contain a 2-Dimentional array of floats. The constructor should initialize a passed value to all the locations of the array being created and if the argument is missing, it should assign 0 by default to the entire array. Define appropriate functions for inserting data into the matrix and displaying the array in a matrix form. You need to define a function by the name of ‘dot’ that would take a matrix object as an argument and would return the matrix object (temporary) to where it was called from. From where it was called, there it should assign the returned object to a new matrix class instance.
Matrix obj3=obj1.dot(obj2);
Call the display function from the new instance to see the result of two matrices multiplied.
NOTE: Define a function ’float retreive(int, int)’ where if two indices are
passed to it, it must return the value located at those locations.
A network is given as 190.28.0.0/16. Eight subnets are to be created.
(a)What will be the CIDR network prefix?
(b)Express last subnet in dotted decimal notation with mask.
(c) What is the maximum number of hosts in each subnet?
(d) What is the address range for hosts in second subnet?
(e) What is the subnet broadcast address for the first subnet?
Create a class by the name of ‘Product’. Create the following private members
name(String), price(Int) and quantity(Int). Define a parameter-less and a
parameterized constructor. Define the following two member functions outside the class,
void getData()
static void counter()
static int countProduct()
The class would contain a static int ‘totalProduct’, having initial value equal to zero.
Each time an instance of the product class is created, the ‘counter()’ should be called.
The ‘counter()’ increments the static member by 1 value. Suppose I create 5 products,
when I execute the following code it should display 5.
Product::totalProducts;
Two 8 bit numbers in a hexadecimal are 05 and 06. Obtain the checksum.
Create a 'Circle' class with having a static data member name 'radius' and two pointer
data members name 'circumference' and 'area' as private. Allocate memory to the
two pointers in both parameter-less and parameterized constructors - parameterized
constructor must take a single float argument for radius. Define a deep copy constructor for
the class. Note that the constructor should assign data as well as calculate 'area' and
'circumference' based on the formulae. Two other functions with return type float
must return the value 'circumference' and 'area' are holding. Get rid of the
allocated space in destructor.
At 450°C ,the Kp for the reaction N2(g)+ 3 H2(g) 2NH3(g) is 4.5 x 10-5 . For each mixture listed,indicate whether the mixture is at equilibrium at 450°C. If it is not at equilibrium,indicate the direction (toward product or toward reactants) in which the mixture must shift to achieve equilibrium.
Write a program in C++ to find the largest and smallest of N numbers of any data type (use function overloading). The value of N is available only at the time of execution