i also want help in this assignment
CS301 Data Structures Assignment No. 1 Solution and Discussion Fall 2014 Due Date: November 17, 2014View more random threads:
- ENG 301 BC Asignment Business Communication (May,3,2010)
- Virtual University of Pakistan 7th convocation
- HRM627 Human Resource Development Assignment No. 2 Fall...
- Fall 2010_MTH101_4
- CS101 Assignment no 3 Solution 20th January 2016
- CS201 Introduction to Programming Assignment 3 May13,2010
- answer
- fin621 assignment
- MTH101 - Calculus And Analytical Geometry Assignment 4...
- CS201-Introduction to Programming Assignement No.1 Due Date...
Sponsored Links
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
#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;
}
:o:o--------------------------------------------------------------------------------------:o:o
[B]The more knowledge you have, the greater will be your fear of Allah.[/B]
Please Join My [B]Group Vuhelp[/B][B], Birthday Wishing, Daily Hadees[/B] [CODE][B]http://vuhelp.net/groups/vuhelp.html[/B]
[B]http://vuhelp.net/groups/birthday-wishing.html[/B]
[B]http://vuhelp.net/groups/daily-hadees.html[/B][/CODE]
[CENTER][B][COLOR="Red"][SIZE="4"]Email: [email]viki@vuhelp.net[/email][/SIZE][/COLOR][/B][/CENTER]
#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");
}
:o:o--------------------------------------------------------------------------------------:o:o
[B]The more knowledge you have, the greater will be your fear of Allah.[/B]
Please Join My [B]Group Vuhelp[/B][B], Birthday Wishing, Daily Hadees[/B] [CODE][B]http://vuhelp.net/groups/vuhelp.html[/B]
[B]http://vuhelp.net/groups/birthday-wishing.html[/B]
[B]http://vuhelp.net/groups/daily-hadees.html[/B][/CODE]
[CENTER][B][COLOR="Red"][SIZE="4"]Email: [email]viki@vuhelp.net[/email][/SIZE][/COLOR][/B][/CENTER]
yah tu seprate files han beaware of it................................dont copy paste in one file and send u will get zero atleast change variable names.
Urgent call: 03455242488. | Virtual University Assignments
Virtual University GDBs | Virtual University Papers | Vu Projects | Vu Handouts
About Expert
There are currently 1 users browsing this thread. (0 members and 1 guests)