Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

USE PYTHON!!!!!!!!!!!!!!! nce. write a class i ntOueue that stores a queue of i

ID: 3697845 • Letter: U

Question

USE PYTHON!!!!!!!!!!!!!!!

nce. write a class i ntOueue that stores a queue of i nt·s. A queue ems on one end and removes/dequeues from the other. You MUST om list. Errors will result if any code attempts to enqueue anything 2. Container/ tainer/Inheritance. Writ ueues it inherit/subclass from 1 other than an intQueue. int, or, if code attempts to assign to a location in the middle of the An intQueue can be constructed with a given list, if none is given it defaults to the em list: >>>intQueue) intQueue ([1) >>> intQueue (13,4,51) intQueue[[3, 4, 5)) The method enqueue adds to the back, dequeue removes from the front and returns the item qintQueue (15,61) >>> q.enqueue (7) >>>q.enqueue (8) intQueue (I5, 6, 7, 8]) >>> q.dequeue )--5 True >>> q.dequeue )--6 True intQueue ((7, 81) Any attempt to add anything but an int raises an error. This can happen in enqueue or the constructor >>>iq intQueue ) >>>iq.enqueue ( 5.5 Traceback (most recent call last): NotIntError: 5.5 is not an int >>> iq.enqueue( 'hello' Traceback (most recent call last): NotIntError: hello is not an int >>>iq.enqueue( [) Traceback (most recent call last): NotIntError: [ is not an int >>> intQueue ( 13, 4 . 55,5)) Traceback (most recent cal1 last): NotIntError: 4.55 is not an int ...continues on next page...

Explanation / Answer

public