Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


CS301 Data Structures Assignment No 02 Fall 2020 Solution / Discussion

Views: 1841

Replies to This Discussion

Share the Assignment Questions & Discuss Here.... 

CS301_Assignment_No_02_Solution_Fall_2020

Click on the below link to download the file

CS301_Assignment_No_02_Solution_Fall_2020

CS301_Assignment_No_02_Solution_Fall_2020

cs301 Corect Solution

Click on the below link to download the file

cs301 Corect Solution

CS301 Assignment No. 2 Fall 2020 || 100% Correct Solution by VU ACADEMY

CS301_Assignment_No_02_Solution_Fall_2020

Click on the below link to download the file

CS301_Assignment_No_02_Solution_Fall_2020

CS301 Assignment 2 Fall 2020 Solution:

#include
#include
using namespace std;
class queue // Queue Class For Storing Data
{
public:
int age,blood,heart,covid;
string name,gender;
queue *next_add;
};
class list // Linked List Class For Storing Nodes.
{
private:
queue *head = NULL;
public:
void insert();
void display();
void count();
};
void list::insert()
{
system("cls");
int a,b,h,c;
string n,g;
// Take Patient Information.
cout"\n\t\t\t\tNew Patient";
cout"\n\n Name : ";
cin>>n;
cout"\n\n Age : ";
cin>>a;
cout"\n\n Gender : ";
cin>>g;
cout"\n\n Blood Sugar (1 for Positive 0 for Negtive) : ";
cin>>b;
cout"\n\n Heart Decease (1 for Positive 0 for Negtive) : ";
cin>>h;
cout"\n\n COVID-19 (1 for Positive 0 for Negtive) : ";
cin>>c;
// Insert Record into Node.
queue *new_node = new queue;
new_node -> name = n;
new_node -> age = a;
new_node -> gender = g;
new_node -> blood = b;
new_node -> heart = h;
new_node -> covid = c;
new_node -> next_add = NULL;
// Add Node into Linked List.
if(head == NULL)
head = new_node;
else
{
// Check Last Node.
queue *ptr = head;
while(ptr -> next_add != NULL)
{
ptr = ptr -> next_add;
}
ptr -> next_add = new_node;
}
cout"\n\n Patient Information Inserted Successfully...";
}
void list::display()
{
system("cls");
cout"\n\t\t\t\tDisplay All Information";
queue *ptr = head;
while(ptr != NULL)
{
cout"\n\n Name : "< name;
cout"\n\n Age : "< age;
cout"\n\n Gender : "< gender;
(ptr -> blood == 1) ? cout"\n\n Blood Sugar : Positive" : cout"\n\n Blood Sugar : Negtive";
(ptr -> heart == 1) ? cout"\n\n Heart Decease : Positive" : cout"\n\n Heart Decease : Negtive";
(ptr -> covid == 1) ? cout"\n\n COVID-19 : Positive" : cout"\n\n COVID-19 : Negtive";
cout"\n\n **************************************";
ptr = ptr -> next_add;
}
}
void list::count()
{
int m=0,f=0,k=0,o=0,b=0,h=0,c=0,r=0;
cout"\n\n\n\t\t\t\tCounted Information";
queue *ptr = head;
while(ptr != NULL)
{
if(ptr -> gender == "Male" || ptr -> gender == "male")
m++;
else
f++;
if(ptr -> age < 15)
k++;
else if(ptr -> age > 50)
o++;
if(ptr -> blood == 1)
b++;
if(ptr -> heart == 1)
h++;
if(ptr -> covid == 1)
c++;
if(ptr -> blood == 1 && ptr -> heart == 1 && ptr -> covid == 1 && ptr -> age > 50)
r++;
ptr = ptr -> next_add;
}
cout"\n\n Number Of Male Patients : "m;
cout"\n\n Number Of Female Patients : "f;
cout"\n\n Number Of Kids Patients : "k;
cout"\n\n Number Of Patients Have Age Over 50 : "o;
cout"\n\n Number Of Patients Have Blood Sugar Decease : "b;
cout"\n\n Number Of Patients Have Heart Decease : "h;
cout"\n\n Number Of Patients Have COVID-19 : "c;
cout"\n\n Number Of High Risk Patients : "r;
}
main() // Main Function
{
list l;
char choice;
// Call Insert Function.
do
{
l.insert();
cout"\n\n Do You Want Add Another Patient (Y,N) : ";
cin>>choice;
}while(choice == 'y' || choice == 'Y');
// Call Display Function.
l.display();
// Call Count Information Function.
l.count();
getch();
return 0;
}

there is error in this code

#CS301_Assignment2_fall2020 #vuhelp #virtualuniversity
CS301 Assignment No.2 Idea Solution✅ Fall 2020✅ Virtual University

DOWNLOAD CS301 ASSIGNMENT SOLUTION IN .CPP FILE FROM LINK BELOW THANKS

#CS301ASSIGNMENTNO2FALL2020cs301cs301 assignmentcs301 assignment 2cs301 assignment 2 solutioncs301 assignment 2 solution 2019cs301 assignment 2 solution 2020cs301 assignment 2 solution fall 2018cs301 assignment 2 solution fall 2019cs301 assignment 2 solution spring 2020cs301 assignment 2020cs301 assignment no 2cs301 assignment no 2 solutioncs301 assignment no 2 solution 2020cs301 assignment no 2 solution spring 2020cs301 assignment solutioncs301 pdfcs301 solutioncs301 solved pdf

CLICK ON LINK BELOW TO DOWNLOAD

CS301-ASSIGNMENT-NO2-FALL-2020-SOLUTION

CS301 assignment 2 Solution idea 2:

#include<iostream>
#include<conio.h>
using namespace std;
class queue // Queue Class For Storing Data
{
public:
int age,blood,heart,covid;
string name,gender;
queue *next_add;
};
class list // Linked List Class For Storing Nodes.
{
private:
queue *head = NULL;
public:
void insert();
void display();
void count();
};
void list::insert()
{
system("cls");
int a,b,h,c;
string n,g;
// Take Patient Information.
cout"\n\t\t\t\tNew Patient";
cout"\n\n Name : ";
cin>>n;
cout"\n\n Age : ";
cin>>a;
cout"\n\n Gender : ";
cin>>g;
cout"\n\n Blood Sugar (1 for Positive 0 for Negtive) : ";
cin>>b;
cout"\n\n Heart Decease (1 for Positive 0 for Negtive) : ";
cin>>h;
cout"\n\n COVID-19 (1 for Positive 0 for Negtive) : ";
cin>>c;
// Insert Record into Node.
queue *new_node = new queue;
new_node -> name = n;
new_node -> age = a;
new_node -> gender = g;
new_node -> blood = b;
new_node -> heart = h;
new_node -> covid = c;
new_node -> next_add = NULL;
// Add Node into Linked List.
if(head == NULL)
head = new_node;
else
{
// Check Last Node.
queue *ptr = head;
while(ptr -> next_add != NULL)
{
ptr = ptr -> next_add;
}
ptr -> next_add = new_node;
}
cout"\n\n Patient Information Inserted Successfully...";
}
void list::display()
{
system("cls");
cout"\n\t\t\t\tDisplay All Information";
queue *ptr = head;
while(ptr != NULL)
{
cout"\n\n Name : "ptr -> name;
cout"\n\n Age : "ptr -> age;
cout"\n\n Gender : "ptr -> gender;
(ptr -> blood == 1) ? cout"\n\n Blood Sugar : Positive" : cout"\n\n Blood Sugar : Negtive";
(ptr -> heart == 1) ? cout"\n\n Heart Decease : Positive" : cout"\n\n Heart Decease : Negtive";
(ptr -> covid == 1) ? cout"\n\n COVID-19 : Positive" : cout"\n\n COVID-19 : Negtive";
cout"\n\n **************************************";
ptr = ptr -> next_add;
}
}
void list::count()
{
int m=0,f=0,k=0,o=0,b=0,h=0,c=0,r=0;
cout"\n\n\n\t\t\t\tCounted Information";
queue *ptr = head;
while(ptr != NULL)
{
if(ptr -> gender == "Male" || ptr -> gender == "male")
m++;
else
f++;
if(ptr -> age < 15)
k++;
else if(ptr -> age > 50)
o++;
if(ptr -> blood == 1)
b++;
if(ptr -> heart == 1)
h++;
if(ptr -> covid == 1)
c++;
if(ptr -> blood == 1 && ptr -> heart == 1 && ptr -> covid == 1 && ptr -> age > 50)
r++;
ptr = ptr -> next_add;
}
cout"\n\n Number Of Male Patients : "m;
cout"\n\n Number Of Female Patients : "f;
cout"\n\n Number Of Kids Patients : "k;
cout"\n\n Number Of Patients Have Age Over 50 : "o;
cout"\n\n Number Of Patients Have Blood Sugar Decease : "b;
cout"\n\n Number Of Patients Have Heart Decease : "h;
cout"\n\n Number Of Patients Have COVID-19 : "c;
cout"\n\n Number Of High Risk Patients : "r;
}
main() // Main Function
{
list l;
char choice;
// Call Insert Function.
do
{
l.insert();
cout"\n\n Do You Want Add Another Patient (Y,N) : ";
cin>>choice;
}while(choice == 'y' || choice == 'Y');
// Call Display Function.
l.display();
// Call Count Information Function.
l.count();
getch();
return 0;
}

cs301 Corect Solution

Click on the below link to download the file

cs301 Corect Solution

RSS

Looking For Something? Search Below

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

Latest Activity

saba zulfqar liked Asrukh's discussion Kuch Dost Bahut Yaad Aate Hai,
3 minutes ago
Honey Chaudhary replied to Asrukh's discussion Bhale Dino Ki Baat Hai...
19 minutes ago
Honey Chaudhary liked Asrukh's discussion Bhale Dino Ki Baat Hai...
19 minutes ago
Honey Chaudhary liked Asrukh's discussion Kuch Dost Bahut Yaad Aate Hai,
23 minutes ago
Honey Chaudhary liked Asrukh's discussion hamesha der kar detā huuñ
23 minutes ago
Mani Siddiqui posted a status
41 minutes ago
Mani Siddiqui posted a status
"کمال بات یہ ہے کہ لفظوں سے ہی خاموشی ٹوٹتی ہے اور لفظ ہی خاموش کر دیتے ہیں!!"
59 minutes ago
Ammara Sabir posted a status
"اِک تم ہی ہو______________جو دل میں سما گے ہو::❤❤ ورنہ کوششں_____________تو ہزاروں نےکی تھی"
1 hour ago

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service