Create a class Android_Device. The data members of the class are IMEIno (int), Type (String), Make (String), Modelno (int), Memory(float), Operating_System(String). Then Implement member functions to:
1. Set the values of all data members.
2. Display the values of all data members
#include <iostream>
class Android_Device {
int IMEIno;
std::string type;
std::string make;
int modelno;
float memory;
std::string operating_system;
public:
void Set(int imei
, std::string tp
, std::string mk
, int no
, float mem
, std::string os
) {
IMEIno = imei;
type = tp;
make = mk;
modelno = no;
memory = mem;
operating_system = os;
}
void Display() {
std::cout << "IMEIno: " << IMEIno << "\n";
std::cout << "Type: " << type << "\n";
std::cout << "Make: " << make << "\n";
std::cout << "Modelno: " << modelno << "\n";
std::cout << "Memory: " << memory << "\n";
std::cout << "OS: " << operating_system << "\n";
}
};
int main() {
Android_Device device;
device.Set(1, "some type", "maker", 2, 1024.f, "Windows");
device.Display();
return 0;
}
Comments
thanks :) ..you a great person
Leave a comment