Get to View CS301 Assignment 1 Solution 2021. Correct Data Structure CS301 Assignment 1 Solution Spring 2021 with Download Files.
Check Here Latest Assignment
CS301 Assignment 1 Solution FALL 2021
Provided by VU Answer.com
Objectives:
To enable students to understand code and practice the concepts of topic:
Linked list implementation
Efficient memory management
Efficient use of pointer
Assignment Submission Instructions
You have to submit only a .zip file which will have code (.cpp) and screenshot image files on the assignments interface from your LMS account.
While testing your application and entering the record of the first student, use your VU ID for the name of the student. Take a screenshot of your input which should be showing your VU ID entered as the first student name. Zip your code (.cpp) and screenshot image files and submit zip file from your LMS account.
ZIP, CPP, MSWORD, PDF Files Uploaded Below
ASSIGNMENT CODE:
#include <iostream>
#include<conio.h>
using namespace std;
class student
{
public:
string name;
int code;
student *next_add;
};
class linked_list
{
public:
student *head =NULL;
void menu();
int get_code();
// provided by vuanswer.com
string get_name();
string set_name(string n);
void insert();
void show_all();
void show_one();
void show_two();
void show_three();
void show_four();
};
string linked_list :: get_name()
{
string name;
cout<<"Enter the Name of Student: ";
cout<<" "<<endl;
cout<<"(Enter your student id according to assignment instruction)"<<endl;
cout<<""<<endl;
cin>>name;
cout<<" "<<endl;
return name;
}
int linked_list ::get_code()
{
int code;
// get free assignment solution correctly visit vuanswer.com
cout<<" Course Name Course Code "<<endl;
cout<<"Introduction to Computing 1 "<<endl;
cout<<"Introduction to Programming 2 "<<endl;
cout<<"Data Structures 3 "<<endl;
cout<<"Object Oriented Programming 4 "<<endl;
cout<<" "<<endl;
cout<<"Enter the Course Code: ";
cout<<" "<<endl;
cin>>code;
cout<<" "<<endl;
return code;
}
string linked_list ::set_name(string n)
// free to help whatsapp +923162965677 vuanswer.com
{
return n;
}
void linked_list :: insert(){
student *new_node = new student;
new_node -> name = get_name();
new_node ->code = get_code();
new_node -> next_add = NULL;
if(head==NULL)
{
head = new_node;
}
else {
student *ptr = head;
while (ptr ->next_add != NULL)
{
ptr = ptr -> next_add;
}
ptr -> next_add = new_node;
}
cout<<"Student' s Information Saved Successfully. ";
cout<<" "<<endl;
}
void linked_list ::menu()
{
starting:
int choice;
cout<<"0. Display All Students "<<endl;
cout<<"1. Display All Students Enrolled in Introduction to Computing"<<endl;
cout<<"2. Display All Students Enrolled in Introduction to Programming"<<endl;
cout<<"3. Display All Students Enrolled in Data Structure"<<endl;
// free to changing and new assignment whatsapp +923162965677
cout<<"4. Display All Students Enrolled in Object Oriented Programming"<<endl;
cout<<"5. Close the Program"<<endl;
cout<<" "<<endl;
cout<<"Select an Option for Required Operation: (VUAnswer.com)"<<endl;
cin>>choice;
if(choice == 0){
show_all();
}
else if(choice == 1){
show_one();
}
else if(choice == 2){
show_two();
}
else if(choice == 3){
show_three();
}
else if(choice == 4){
show_four();
}
else if(choice == 5){
exit(0);
}
// switch(choice)
// {
// case 0:
// show_all();
// break;
// case 1:
// show_one();
// break;
// case 2:
// show_two();
// break;
// case 3:
// show_three();
// break;
// case 4:
// show_four();
// break;
// case 5:
// exit(0);
// }
goto starting;
}
void linked_list ::show_all()
{
int count =0;
cout<<" "<<endl;
cout<<"\n Following Student are Enrolled in All Courses."<<endl;
cout<<" "<<endl;
student *ptr = head;
while (ptr != NULL)
{
cout<<"\n Student Name: "<<set_name(ptr ->name);
count++;
ptr = ptr -> next_add;
}
cout<<"\n Enrollment Count: "<<count;
cout<<" "<<endl;
}
void linked_list :: show_one()
{
int count =0;
cout<<"\n Following Student are Enrolled in Introduction to Computing."<<endl;
student *ptr = head;
while (ptr != NULL)
{
if(ptr -> code == 1){
cout<<"\n Student Name: "<<set_name(ptr ->name);
count++;
}
ptr = ptr -> next_add;
}
cout<<"\n Enrollment Count: "<<count;
cout<<" "<<endl;
// code by vuanswer.com
cout<<" "<<endl;
}
void linked_list :: show_two()
{
int count =0;
cout<<"\n Following Student are Enrolled in Introduction to Programming."<<endl;
student *ptr = head;
while (ptr != NULL)
{
if(ptr -> code == 2){
cout<<"\n Student Name: "<<set_name(ptr ->name);
count++;
}
ptr = ptr -> next_add;
}
cout<<"\n Enrollment Count: "<<count;
cout<<" "<<endl;
}
void linked_list :: show_three()
{
int count =0;
cout<<"\n Following Student are Enrolled in Data Structure."<<endl;
student *ptr = head;
while (ptr != NULL)
{
if(ptr -> code == 3){
cout<<"\n Student Name: "<<set_name(ptr ->name);
count++;
}
ptr = ptr -> next_add;
}
cout<<"\n Enrollment Count: "<<count;
cout<<" "<<endl;
}
void linked_list :: show_four()
{
int count =0;
cout<<" "<<endl;
cout<<"\n Following Student are Enrolled in Object Oriented Programming."<<endl;
student *ptr = head;
while (ptr != NULL)
{
if(ptr -> code == 4){
cout<<"\n Student Name: "<<set_name(ptr ->name);
count++;
}
ptr = ptr -> next_add;
}
cout<<" "<<endl;
cout<<"\n Enrollment Count: "<<count;
cout<<" "<<endl;
}
int main(){
linked_list obj;
char input;
do{
obj.insert();
cout<<"\n Do you want to add another student? ";
cin>>input;
}while(input=='Y' || input == 'y');
obj.menu();
return 0;
}
ASSIGNMENT RESULT
RESULT 1
RESULT 2
GET DOWNLOAD SOLUTION FILES CLICK
MORE SOLUTIONS:
CS502 Assignment 1 Solution 2021
CS304 Assignment 1 Solution 2021
PLEASE NOTE:
Don't copy-paste the same answer.
Make sure you can make some changes to your solution file before submitting copy-paste solution will be marked zero.
If you found any mistake then correct yourself and inform me.
Before submitting an assignment check your assignment requirement file.
If you need some help and question about files and solutions.
MORE ANY ASSIGNMENTS SOLUTION FREE
CS301 Assignment 1 Solution 2021
CS301 Assignment 1 Solution Spring 2021
Download CS301 Assignment 1 Solution 2021 File
0 Comments