Professional Documents
Culture Documents
Virtual University of Pakistan Assignment No.2: Student Id: BC210407489 Course Code: CS201 Name: Isha Liaqat
Virtual University of Pakistan Assignment No.2: Student Id: BC210407489 Course Code: CS201 Name: Isha Liaqat
Assignment No.2
Student id: BC210407489
Course code: CS201
Name: Isha Liaqat
SOLUTION
#include <iostream>
#include <string.h>
// class
class Student
private:
char std_id[20];
char vac_name[10];
int age;
int num_dose;
public:
Student();
strcpy(std_id,student_id );
strcpy(vac_name,Vaccine);
age=Age;
num_dose=dose;
void getName(){
}
void getVaccine(){
void getAge(){
void getDose(){
// setVaccine(const char[])
// setAge(int)
// setDose(int)
// getName()
// getVaccine();
// getAge();
// getDose();
friend void display(Student std1, Student std2);
};
Student::Student(){
// for std1
age=20;
num_dose=1;
strcpy(std_id,students_id);
strcpy(vac_name,Vacine );
age=AGE;
num_dose=Dose;
}
void display(Student std1, Student std2){
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
int main(){
// for std2
int student_2_age=21;
int student_2_dose=2;
Student std1,std2(student_2_id,student_2_vaccaine,student_2_age,student_2_dose),std3;
display(std1,std2);
// for std3
int age=22;
int dose=3;
// setter
std3.setName(id);
std3.setVaccine(vaccaine_name);
std3.setAge(age);
std3.setDose(dose);
// getter
cout<<" "<<endl;
std3.getName();
std3.getVaccine();
std3.getAge();
std3.getDose();
cout<<" "<<endl;
return 0;
OUTPUT