Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question
9
am
Input
3
5
7
~ 00
2
Write a program that repeatedly gets integer input from the user until the value 99999 is entered. The
program must then print the values the user entered alternating between odd and even values
starting with the first odd value as in the examples below. The odd and even values must respectively
be in the order they were entered but the overall output will not necessarily be in the order entered.
8
If more odd or even values were entered, the program should continue to print the remaining values
after all other odd/even values have been printed in the order they were entered.
Note: You must use Queues to solve this problem: an implementation of the Queue class is given -
you do not need to provide your own. You will have the following methods available from the Queue
class: Queue), enqueue(), .dequeue(), peek(), len(), and.is_empty().
Note: You must NOT access private data fields of the Queue class, you must NOT create any other
built-in collections (e.g. lists, tuples, sets, dictionaries, etc)
For example:
Enter a number: 9
Enter a number: 3
Enter a number: 5
Enter a number: 7
Enter a number: 2
Enter a number: 8
Enter a number: 99999
9
WN6
Result
2
99999 3
857
expand button
Transcribed Image Text:9 am Input 3 5 7 ~ 00 2 Write a program that repeatedly gets integer input from the user until the value 99999 is entered. The program must then print the values the user entered alternating between odd and even values starting with the first odd value as in the examples below. The odd and even values must respectively be in the order they were entered but the overall output will not necessarily be in the order entered. 8 If more odd or even values were entered, the program should continue to print the remaining values after all other odd/even values have been printed in the order they were entered. Note: You must use Queues to solve this problem: an implementation of the Queue class is given - you do not need to provide your own. You will have the following methods available from the Queue class: Queue), enqueue(), .dequeue(), peek(), len(), and.is_empty(). Note: You must NOT access private data fields of the Queue class, you must NOT create any other built-in collections (e.g. lists, tuples, sets, dictionaries, etc) For example: Enter a number: 9 Enter a number: 3 Enter a number: 5 Enter a number: 7 Enter a number: 2 Enter a number: 8 Enter a number: 99999 9 WN6 Result 2 99999 3 857
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY