Q.Write a Program in C++ that initializes a class ratio with no parameters as a default constructor and add a parametrized constructor that initializes the declared object. Constructor must initialize the object & the output should print the ratio as per the constructor.
Answers
Answer: I also need this answer
Explanation: because due is before 3 pm
PRACTICAL QUESTIONS-C++
Q.1.Implement a class circle representing a circle storing its
radius as float. Include default constructor, access function. The
program must print radius, area and circumference of circle
where x,y are coordinates of the circle.
Q.2.WAP in C++ that initializes a ratio class with no parameters
as default constructor.The program must print the message
‘Object is born’ during initialization. It should display the
message ‘Object is alive’ when the first member function is
called .when the class destructor is called for the object it
should display ‘Object is dead’.
Q.3.WAP in C++ that initializes a class ratio with no parameters
as a default constructor and add a parametrized constructor
that initializes the declared object. Constructor must initialize
the object & the output should print the ratio as per the
constructor.
Q.4.Write a program in C++ that first initializes an array 5 given
nos. The program must add these numbers by traversing this
array with the size of numbers to which it points. The program
must also print the sum and pointer address with addition of
every no as well as ending address.
Q.5.Write a program in C++ that exchanges data (passing by
reference) using swap function to interchange the given two
nos.