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:
- fin621 assignment solution
- MGT613 - Production / Operations Management GDB
- MGT211 Introduction To Business Assignment No.1 Solution...
- PAK301 Spring 2010 Solution
- Cost & Management Accounting (MGT402) fall 2010 solution no...
- ECO401 Post Comment Fall 2011
- Assignment No. 01 Semester: FALL 2010 CS506: Web Design &...
- MCM401 Fundamentals of Public Relations Assignment No. 01...
- Economics (ECO401) first assignment 27th october, 2010
- CS601 Assignment 4 Solution 12 July 2010
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:
Sponsored Links
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)