Write a function named filteronmax that takes a queue of


1.Write a function named filterOnMax that takes a queue of integers and an integer value named max as parameters and returns a new queue of integers that contains only the values in the original queue that are less than or equal to the value of max. The new queue should preserve the order of the old Queue, and the old Queue should be empty when this method is finished. There is no guarantee that the values in the input queue will be sorted. Your function should display an understanding of FIFO Queue processing so make sure your code use only queue operations on the queue objects (push, pop, front, etc).

2. Write a function named filterOutVowels that takes a stack of characters and returns a new stack of characters that contains only the values in the original stack that are not vowels ('a','e','i','o','u'). When the method is complete, the original stack should be empty. The new stack must have its elements in the same order as the original stack, so you will need to do something to preserve the order of the original stack as you are making your choices (hint - you will want to use a third stack beyond just the input and output stacks). Your code should work for capital or lowercase letters. Your method should display an understanding of stack processing, so make sure your code uses only stack operations on your stack objects (push, pop, and top).

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a function named filteronmax that takes a queue of
Reference No:- TGS0661969

Expected delivery within 24 Hours