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