Questions: 11 448

Answers by our Experts: 10 707

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 & Filtering

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.


Consider the code snippet given below:-

 [Assume the necessary header files and namespaces included]

int main()

{ int a[10];

 cout<<”enter the elements of the array\n”;

 for(int i=0;i<10;i++)

 cin>>a[i];

 

 

return 0;

}

 Complete the code such that the even and odd numbers from the array ‘a’ are stored into two different arrays. The size of these arrays should be same as that of the number of elements and their memory should be deallocated after displaying the odd and even numbers.


Class Template – Array

Write a C++ program to create a class template using an array. Perform operations like sorting, searching, and displaying the array using a class template.

A class named Array with the following member variables.

Data TypeVariable NameIntegersizeT*array



Function NameDescriptionvoid sorting()      This function is used to sort the array elements in ascending order and display the array.void search(T &search)                      This function is used to search the array element, if the element is found display "Element found at position x" else print "Element not found"

Sample Input and Output 1:

Menu

1.Sorting integer array

2.Searching array of double values

Enter your choice:

1

Enter size of array:

3

Enter the array elements:

5

2

55

Sorted array

2

5

55


Can you write a C++ program that compute the given formula below sqrt{A+C∗(D∗E) /(F+G) ∗ (H∗J)}-C and request user name before computation

Your horse has to have 1 ounce of probiotic supplement a day. You can buy it per


pound, as a 10 lb pail at a 10% discount, or as a 20 lb pail at a 15% discount. Your


goal is to produce formatted output showing the daily cost for each buying


option. You should ask the user to enter the price per lb.



Your horse has to have 1 ounce of probiotic supplement a day. You can buy it per


pound, as a 10 lb pail at a 10% discount, or as a 20 lb pail at a 15% discount. Your


goal is to produce formatted output showing the daily cost for each buying


option. You should ask the user to enter the price per



Write a program to calculate the number of objects created and destroyed for the
counter class.
LATEST TUTORIALS
APPROVED BY CLIENTS