Home Education Cs201 Assignment 2 Solution Spring 2022

Cs201 Assignment 2 Solution Spring 2022

by Usman CB
Cs201 Assignment 2 Solution Spring 2022

Are you looking for Cs201 Assignment 2 Solution Spring 2022?  If yes Then Your Landed on the Right Place . Here you will get all about important you needed as well as This Website is for Assignment Quiz and Gdbs of Virtual University of Pakistan. 

Cs201 Assignment 2 Spring 2022

As we know the question is uploaded on the LMS.

Download Cs201 Assignment 2 Solution Spring 2022




using namespace std;
class Student{
char std_id[20], vac_name[10];
int age,num_dose;
Student() {
age = 20;
num_dose = 1;
Student(const char id[], const char vac[], int aAge, int dose) {
age = aAge;
num_dose = dose;
void setName(const char id[]) {
void setVaccine(const char vac[]) {
void setAge(int A) {
age = A;
void setDose(int D) {
num_dose = D;
char* getName() {
return std_id;
char* getVaccine() {
return vac_name;
int getAge() {
return age;
int getDose() {
return num_dose;
friend void display(Student std) {
cout<<“Student ID: “<< std.std_id <<endl;
cout<<“Age: “<< std.age <<endl;
cout<<“Vaccination: “<< std.vac_name <<endl;
cout<<“Vaccination Doses: “<< std.num_dose <<endl;
int main() {
Student std1;
Student std2(“BC123456789″,”Sinopharm”,22,21);
Student std3;
cout<<“Printing std1 Object values using display() …\n”<<endl;
cout<<“Printing std2 Object values using display() …\n”<<endl;
cout<<“Printing std3 Object values using getter() method…\n”<<endl;
cout<<“Student id: “<<std3.getName()<<endl
<<“Age: “<<std3.getAge()<<endl
<<“Vaccination: “<<std3.getVaccine()<<endl
<<“Vaccination Dose: “<<std3.getVaccine()<<endl;


return 0;


Note: DOn’t Copy Paste this code but Change All those things that are mentioned in the assignment but Code is 100% ok for Cs201 Assignment 2 Solution Spring 2022!

Also Read:

CS201 Final Term Important Files By Concepts Builder

Mth101 Assignment 2 Solution Spring 2022

CS302 Final Term Important Files | CS302 Solved Files

CS301 Final Term Important Files | Mcq’s And Short Notes

Related Posts

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.