C++ Answers

Questions answered by Experts: 9 913

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Create a Class parten wien data mentides

name

gender

and member functions to perform the following

operations:

a Accopt the details of an person

b. Display the details of an person
Creath a Cluss teacher with data members

teacher number,

name,

Salary

and member functions to perform the following operations

a. Accept the details of a teacher

b. Display the details of a teacher
Write an efficient program to determine if a positive integer, N, is prime.
and In terms of N, analyze the worst-case running time of your program?

Due to a rush at the end of the exam, Professor could not arrange the answer sheets in the

sequence as desired. However, he mentioned the correct location of each answer sheet with it.

Now, Professor wants all the answer sheets in the desired sequence.prepare a linklist having a data, the location, and the link node to arrange the data in the in the increasing manner of the location variable.

HINT: Item ,location ,linknode

input: 5 3 ->6 2 ->4 1->2 4 NULL

output: 4 1->6 2->5 3->2 4 NULL


Write a program to implement a searching algorithm on a skip list having two layers as
shown in below figure:
Assume that the linked list is already sorted. Write your observations on the time complexity of
the algorithm.
(You may go through the link: https://www.geeksforgeeks.org/skip-list/)
. Due to a rush at the end of the exam, Professor could not arrange the answer sheets in the
sequence as desired. However, he mentioned the correct location of each answer sheet with it.
Now, Professor wants all the answer sheets in the desired sequence.
Write a program to transpose a sparse matrix represented as an array of nx3 size, as
mentioned in problem 1.A. The time complexity of the algorithm should be order of n and the
space complexity should be order of 1.
Write a program to convert a sparse matrix from a 2D array into
A. An array representation of nx3 size, where n is the number of non-zero elements in the
sparse matrix and each element is represented by row, column, and data.
B. A chain list (Linked list representation of the sparse matrix where each non-zero element
is represented by a node containing the data, row, column, and a pointer)

Write a program to read the GPA of students from users and display the details using dynamic memory allocation.


Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.

Include the following member function in the Main class

Member FunctionDescriptionvoid display(float arr[], int size)This method is used to display the student's GPA details.

 

In the main method, obtain input from the user in the console and call the display method to display the GPA details.

Note:

Use a new keyword to create a dynamic array to store the GPA details.

OUTPUT

Enter total number of students:

2

Enter GPA of students

7.8

6.7

Students GPA Details

Student1 : 7.8

Student2 : 6.7


For the given code your task is to write the following functions and make menu to call them in main:

1)Insert_Element_at(int X, int pos),

2)bool Delete_Element(int X)

3) void Empty_List()


class List{

public:

int item;

int pos;

List* nextNode;

List()

{

this->pos=0;

}


List(int pos)

{

this->pos=pos;

}


List(int item,int pos)

{

this->item=item;

this->pos=pos;

}


List(List &list)

{

this->item=list.item;

this->pos=list.pos;

this->nextNode=list.nextNode;

}

};


void Insert_Element(List** head, int data)

{

//code present here to do this

}


LATEST TUTORIALS
APPROVED BY CLIENTS