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

There is a structure called employee that holds information like employee code, name, date of joining. Write a program to create an array of the structure and enter some data into it. Then ask the user to enter current date. Display the names of those employees whose tenure is 3 or more than 3 years according to the given current date


ask the user to enter the year (can be 1,2,3,) &corce (HNDIT,HNDM,HNDA)

if year is 2&corece is HNDIT show him "it is time to garduate soon"

if year is 2&corece is HNDA show him "it is time to garduwate in 2 years "

if year is 3&corece is HNDM show him "it is time to garduwate soon "

if is 1 show him "you have more time in garduwate"




Create a single class which
1)implements the functions of one and two dimension array
2)insert elements in the array until user presses - 1
3)delete the elements until user presses - 1 or when array is empty
4)display the data after each insertion and deletion of element
5)if array is full create a larger array and copy the elements to there
6)display elements one by one as they will be copied and deleted after copying

NOTE:
1)create dynamic 1d and 2d arrays
2) test the functions in main
3)user should have the ability to choose whether he wants to create 1d or 2d array

Given a string, an integer position, and an integer length, all on separate lines, output the substring from that position of that length.

Ex: If the input is:

Fuzzy bear

3

4

the output is:

zy b

Note: Using a pre-defined string function, the solution can be just one line of code.

#include <iostream>

#include <string>

using namespace std;


int main() {

string strVal;

int posStart;

int choiceLen;

string newString;


getline(cin, strVal);

cin >> posStart;

cin >> choiceLen;


cout << newString << endl;

return 0;

}


Write a C++ program that tells the size of linked list and counts the elements present in the list and displays the data

Note:
no global declarations
Make class or struct
Write C++ program that that contain functions
1) A function to Delete the last node of doubly Linked List
2)A function at deletes the 2nd-last node of the doubly Linked List
3)A function that displays the Linked lists
Call the functions in main

NOTE:
1) make class or struct
2)No global declarations
Towers of Hanoi: One of the most popular puzzle is called Towers of Hanoi . It consists
of three rods (or towers) with a specific number of disks with different sizes in one
rod, arranged in ascending order (from the top) from smallest to largest. The goal
is to move the stack of disks from the starting rod to any of the other two. But there
are certain rules to be followed. Firstly, place randomly disks in the towers
The rules of the puzzle are:
• Only one disk may be moved at a time.
• Each move consists of taking the upper disk from one of the rods and sliding it
onto another rod, on top of the other disks that may already be present on that
rod.
• No disk may be placed on top of a smaller disk.

Write C++ code for the above problem
Implement the following function. You may use the stack template class and the
stack operations of push, pop, peek, is_empty, and size. You may also use cin.peek( )
and use "cin>>i" to read an integer.
int evaluate_postfix_from_cin( )
// Precondition (Which is not checked): The next input line of cin is a
// properly formed postfix expression consisting of integers,
// the binary operations + and -, and spaces.
// Postcondition: The function has read the next input line (including
// the newline) and returned the value of the postfix expression.
{
int i;
stack<int> s;
Write complete code
Create class or struct and functions,then implement doubly Linked List operations such as
1)insertion(at start, given pos and at end)
2)deletion(at start, given pos and at end)
3)search
4)reverse
5)reversing k Nodes
6)sort
7)display

Note:
1)Create a manu in main to call all the functions one-by-one
2)no global declarations

Name Surname Score

1. Sam Williams 60

2. John Phoenix 85

3. Simon Johnson 75

4. Sarah Khosa 81

5. Mat Jackson 38

6. Nick Roberts 26

7. Isaac Wayne 74

8. Anna Mishima 34

9. Daniel Rose 64

10. Aaron Black 83

11. Jack Mohamed 27

12. Kathrine Bruckner 42

Create a C++ program that has 3 Stacks.

Insert, into the first stack, all the data above (which is the data of student’s names, surnames and the marks they obtain in a particular assessment)

Display the content of the stack on the screen (console)

Then, remove all the students whose surname starts with the alphabets ‘R’, ‘J’ and ‘M’, from the first stack and insert them into the second Stack.


Display the contents of Stack1 and Stack2.

Finally, remove all the students whose marks are less than 50 from both Stack1 and Stack2 and insert them into the Third Stack.

Display the contents of all the 3 Stacks.


LATEST TUTORIALS
APPROVED BY CLIENTS