For Daily Free Study Material Join wiredfaculty Whatsapp Group | Download Android App | Ncert Book Download
Sponsor Area
Write the definition of a class METROPOLIS in C++ with the following description:
Private Members
-Mcode //Data member for Code (an integer)-MName //Data member for Name (a string)-MPop //Data member for Population (a long int)-Area //Data member for Area Coverage (a float)-PopDens //Data member for Population Density (a float)CalDen()//A member function to calculate //Density as PopDens/Area
Public Members
-Enter() //A function to allow user to enter values of //Mcode,MName,MPop,Area and call CalDen() //function-ViewALL()//A function to display all the data members //also display a message ”Highly Populated Area” //if the Density is more than 12000