CS201 MID TERM SOLVED MCQs || PAST PAPERS || GROUP-1 || INTRODUCTION TO PROGRAMMING || VuTech Visit Website For More Solutions www.vutechofficial.blogspot.com …
You have to use only Linked List data structure for this assignment. Your marks will be deducted if any other data structure is used
Your program should perform the below mentioned operations on the output console:
§Linked List will be used to store the information of all candidates.
§The program will accept “Candidate Name” ,“subject test marks”, “interview marks” as input parameters.
§The candidate will only be considered eligible for post of lecturer if he/she secures more than 70 marks in the subject test and more than 80 marks in the interview. Otherwise he/she will be considered ‘ineligible’
§The program should display the record of eligible and ineligible candidates separately.
Solution Guidelines:
1)Understand and practice the following topics before developing this assignment::
R Nodes
R List
R Linked List
RLinked List Methods
2)To save candidate information, use the Linked List data structure. Each candidate will be represented by a node that contains the following information: candidate name,subject test score,interview marks,and status (eligible/ineligible).
3)Your solution should use these classes:
a.Candidate (Node) Class: To save information of each candidate
b.List Class: To save all candidates in linked list
Sample Output
See the attached video file (output.mp4) to see the sample output.
Labs Covered:
This assignment covers Lab # 1- 3
Deadline:
Your assignment must be uploaded / submitted on / before, Monday 5th December 2022
How to and install Dev C++ latest version || By VuTech
👇👇👇👇
SOLUTION:
#include<iostream>
using namespace std;
class Applicant{
private:
int Id, testScore, interviewmarks;
string name, status;
Applicant *nextCandidate;
public:
void setId(){
cin>>Id;
}
int getId(){
return Id;
}
void setName(){
cin>>name;
}
string getName(){
return name;
}
void setTestScore(){
cin>>testScore;
}
int getTestScore(){
return testScore;
}
void setInterviewmarks(int i){
interviewmarks=i;
}
int getInterviewmarks(){
return interviewmarks;
}
void setStatus(string s){
status=s;
}
string getstatus(){
return status;
}
void setNextApplicant( Applicant *ptr){
nextCandidate=ptr;
}
Applicant* getNextApplicant(){
return nextCandidate;
}
};
class Linked_List{
Applicant* head;
Applicant* current;
public:
Linked_List(){
head=NULL;
current=NULL;
}
void addApplicant(){
int i;
Applicant *newNode= new Applicant;
cout<<"Enter the ID of Applicant:"<<endl;
newNode->setId();
cout<<"Enter the Name of Applicant:"<<endl;
newNode->setName();
cout<<"Enter the Test Score of Applicant:"<<endl;
newNode->setTestScore();
if(newNode->getTestScore()>=80){
cout<<"Enter the Interview Marks of Applicant: "<<endl;
cin>>i;
newNode->setInterviewmarks(i);
if(newNode->getInterviewmarks()>50)
newNode->setStatus("Eligible");
else
newNode->setStatus("Ineligible");
}
else
{
newNode->setInterviewmarks(0);
newNode->setStatus("Ineligible");
cout<<"Applicant is not eligible for Job Interview"<<endl;
}
newNode->setNextApplicant(NULL);
if(head==NULL){
head=newNode;
current=newNode;
}
else{
current->setNextApplicant(newNode);
current=newNode;
}
}
void getInformation(){
if(next(head)==true){
cout<<"No Applicant added yet"<<endl;
}
else{
int count=0;
Applicant *ptr=head;
while(next(ptr)==false){
ptr=ptr->getNextApplicant();
count++;
}
cout<<"Total number of Applicant: "<<count<<endl;
}
}
bool next(Applicant *ptr){
if(ptr==NULL){
return true;
}
else{
return false;
}
}
void updateApplicant(){
if(next(head)==true){
cout<<"No Applicant Added Yet"<<endl;
}
else{
int t_id,found=0,i;
cout<<"Enter Applicant ID:";
cin>>t_id;
Applicant *ptr=head;
while(next(ptr)==false){
if(t_id==ptr->getId()){
cout<<"Enter the Name of Applicant:";
ptr->setName();
cout<<"Enter the Test Score of Applicant: ";
ptr->setTestScore();
if(ptr->getTestScore()>=80){
cout<<"Enter the Interview Marks os Applicant: ";
cin>>i;
cout<<endl;
ptr->setInterviewmarks(i);
if(ptr->getInterviewmarks()>50)
ptr->setStatus("Eligible");
else
ptr->setStatus("Ineligible");
}
else{
ptr->setInterviewmarks(0);
ptr->setStatus("Ineligible");
cout<<"Applicant is not Applicable for Job"<<endl ;
}
cout<<"Record Updated"<<endl;
found++;
}
ptr=ptr->getNextApplicant();
}
if(found==0){
cout<<"Applicant ID not found"<<endl;
}
}
}
friend void displayApplicant(Linked_List *obj, int choice){
We provide Virtual University of Pakistan Study Materials such as Solution of Assignments, GDBs, Mid Term Solved Papers, Final Term Solved Papers, Mid Term Solved MCQs, and Final Term Solved MCQs. We also provide regular Semester Quizzes, Updated Handouts, and Short Questions and Answers. We help you with your research and many other educational-related topics, as far as we know. Furthermore, Share your problem with us and Please feel free to ask any related questions.