Answer to Question #209965 in C++ for abrar

Question #209965

 create a class COVID with 6 private data members name, cnic, security code, age, address and blood pressure of patient. Class include public member functions

  1. input ( ) function to input the attributes of patient
  2. verify ( ) function to check security code provided at the time of registration
  3. display ( ) function to display the patient cnic if security code is verified
  4. show ( ) function to display the message NOT REGISTERED if security code doesn’t match Define verify function outside the class using scope resolution operator





1
Expert's answer
2021-06-23T10:10:23-0400
#include<iostream>
using namespace std;
class covid {
public:
  void input(string name, string cnic, int secureCode, int age, string address, string blood) 
  {
    this->name=name;
    this->cnic=cnic;
    this->secureCode=secureCode;
    this->age=age;
    this->address=address;
    this->blood;
  }
  bool verify()
  {
    return this->secureCode;
  }
  void display()
  {
    return '[name:'+name+',cnic'+cnic+',secure code:'+to_string(secureCode)+',age:'+to_string(age)+',address:'+adress+',blood:'+blood+']';
  }
  void show()
  {
    cout << display() << endl;
  }
private:
  string name;
  string cnic;
  int secureCode;
  int age;
  string address;
  string blood;
};

int main() {return 0;}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS