19 3 5 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. 7 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. Input 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: 2 8 199999 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 2 4 m 00 i 3 8 Result 5

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
amin728
9
Input
3
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.
5
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:
99999
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
9N30057
2
Result
8
a number: 99999
Transcribed Image Text:amin728 9 Input 3 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. 5 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: 99999 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 9N30057 2 Result 8 a number: 99999
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education