Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS301 Data Structures Assignment No. 1 Solution and Discussion Fall 2014
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
CS301 Data Structures Assignment No. 1 Solution and Discussion Fall 2014 Due Date: November 17, 2014



Problem Statement:
Suppose a company Oraflex organizes interviews for a vacant post. Assume that the interviews of the successful
candidates after short listing has been started and interview marks are being assigned. You being software
developer of the company are assigned a task to prepare candidates’ list that will store candidates’ information
such as their names, test score, interview marks and then display the selected candidate.
Keeping in view the above scenario, write a program in C++ that will store and display candidates’ names, test
scores, and interview marks. Further, Your program should contain a function to calculate total score of each
candidate. It should also contain a function that will display the total number of candidates appeared. Finally, it
should display the selected candidate.



Solution Guidelines:



Use Linked List to implement above scenario.
Your solution should contain the following two classes:
Candidate class (Node class)
CandidateList class (LinkedList class)
Candidate class should contain constructors, setter and getter functions.
Create a list of candidates and store each candidate’s information in the candidate list.
Display each candidate’s information as given in simple output.
Find and Display total number of candidates appeared in interview.
Find the selected candidate on the basis of highest score obtained.
 Display the selected candidate along with its score (See sample output


Reply
#2
i also want help in this assignment
Reply
#3
#include <conio.h>
#include <iostream>
using namespace std;
int n_prime(int n_last);

int main(int argc, char *argv[])
{
int your_num;
cout"Enter No= ";
cin>>your_num;
cout n_prime(your_num);
system("PAUSE");
return EXIT_SUCCESS;
}

int n_prime(int n_last){
int count,x;
count=0;
for(x=2;x<=n_last/2;x++){
if(n_last%x==0){
count++;
break;
}
}
if(count==0){
cout"Prime"endl;
}else{
cout"Composite"endl;
}
}
{

public:

Stack() { size = 10; current = -1;} //constructor

int pop(){ return A[current--];} // The pop function

void push(int x){A[++current] = x;} // The push function

int top(){ return A[current];} // The top function

int isEmpty(){return ( current == -1 );} // Will return true when stack is empty

int isFull(){ return ( current == size-1);} // Will return true when stack is full
{

1. int x = head->get();

2. Node * p = head;

3. head = head->getNext();

4. delete p;

5. return x;

}
void push(int x)

{

1. Node * newNode = new Node();

2. newNode->set(x);

3. newNode->setNext(head);

4. head = newNode;

}
Reply
#4
#include

using namespace std;
class Node{

public:

void set(int object1){
object = object1;

}
int get(){return object;}
Node *getNext(){return nextNode;}
void setNext(Node *next){this->nextNode = next;}

private:
int object;

Node *nextNode;

};
class List{

public:
List();
void add(int addobject);
int get();
bool next();
friend void traverse(List list);
friend List addNodes();

private:
int size;
Node * headNode;
Node *currentNode;
Node * lastCurrentNode;

};
List::List(){// list constructor
headNode= new Node();
headNode-> setNext(NULL);
currentNode = NULL;
lastCurrentNode=NULL;
size=0;
}
void List::add(int addobject){ //method for add new object
Node * newNode= new Node();
newNode->set(addobject);
if(currentNode!=NULL){
newNode->setNext(currentNode->getNext());
currentNode->setNext(newNode);
lastCurrentNode = currentNode;
currentNode = newNode;
}
else{
newNode->setNext(NULL);
headNode->setNext(newNode);
lastCurrentNode = headNode;
currentNode = newNode;
}
size++;
}
int List::get(){
if(currentNode!=NULL){
return currentNode->get();
}
}
bool List:: next(){
if(currentNode == NULL) return false;
lastCurrentNode = currentNode;
currentNode = currentNode->getNext();
if(currentNode==NULL || size==0) return false;
else return true;

}
void traverse(List list){
Node *savedCurrentNode = list.currentNode;
list.currentNode= list.headNode;
for(int i=1; list.next(); i++){
cout"\n Element "i" "list.get();

}
list.currentNode= savedCurrentNode;
}
List addNodes(){
List list;

list.add(1);
list.add(2);
list.add(3);
list.add(4);
list.add(5);
list.add(6);
cout"\n list size "list.size;
return list;
}
// main method
main(){
List list = addNodes();

traverse(list);

coutendl;
system("pause");
}

Big Grin Big Grin Big Grin Big Grin Big Grin
Reply
#5
yah tu seprate files han beaware of it................................dont copy paste in one file and send u will get zero atleast change variable names.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Cs403 Assignment 3 Helping material May 8,2010 viki 1 5,214 04-28-2020, 03:19 PM
Last Post: ClaireBeauc
  cs301 assignment no 3 Solution 20 January 2016 Vuhelper 0 11,098 01-20-2016, 03:32 PM
Last Post: Vuhelper
  CS201 Assignment vo 3 Solution 20th January 2016 Vuhelper 2 2,609 01-20-2016, 03:28 PM
Last Post: Vuhelper
  CS101 Assignment no 3 Solution 20th January 2016 Vuhelper 0 2,291 01-20-2016, 03:25 PM
Last Post: Vuhelper
  SOC101 INTRODUCTION TO SOCIOLOGY assignment no 3 Solution 20 January 2016 Vuhelper 0 1,884 01-20-2016, 03:19 PM
Last Post: Vuhelper
  CS402 Assignment No 4 Solution & Discussion Xpert 0 2,111 08-01-2015, 02:33 AM
Last Post: Xpert
  cs101 Assignment No. 1 Solution 21 may spring 2015 semester Xpert 0 2,922 05-21-2015, 12:41 AM
Last Post: Xpert
  Assignment solution eng 301 due date 20 may 2015 rumesa khan 3 4,544 05-20-2015, 01:34 AM
Last Post: Xpert
  PHY301 Circuit Theory Assignment No. 1 idea Solution spring may 2015 semester Xpert 0 1,571 05-15-2015, 03:52 AM
Last Post: Xpert
  Assignment No. 01 Spring 2015 Information Systems CS507 idea solution spring 2015 Xpert 0 2,458 05-15-2015, 03:49 AM
Last Post: Xpert

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support