Answer the question (i) and (ii) after going through the following program:
#include<iostream.h>
#include<string.h>
class Bazar
{ char Type[20];
char Product[20];
int Qty;
float Price;
Bazar() //Fuction 1
{
strcpy(Type,"Electronic");
strcpy(Product,"Calculator");
Qty=10;
Price=225;
}
public:
voif Disp() //Function 2
{ cout<<Type<<"-"<<Product<<":"<<Qty<<"@"<<Price<<endl;
}
};
void main()
{
Bazar B; //Statement 1
B.Disp(); //Statement 2
}
(i) Will Statement 1 initialize all the data members for object B with the values given in the Function 1? (Yes OR No). Justify your answer suggesting the correction(s) to be made in the above code
(ii) What shall be the possible output when the program gets executed? (Assuming, if required – the suggested correction(s) are made in the program)