Question: I need help with my Python assignment Ah, the days of automatically-dispensed tobacco products. Once a ubiquitous fixture of sketchy night clubs and bowling alleys,
I need help with my Python assignment
Ah, the days of automatically-dispensed tobacco products. Once a ubiquitous fixture of sketchy night clubs and bowling alleys, the cigarette vending machine brought a touch of style and elegance to carcinogen-laced inhalant devices. You popped in your quarters, pulled the correct knob, and packet of smokes slid down the polished stainless steel chute into your eagerly awaiting nicotine-stained fingers. But with the knowledge that cigarettes in sum were a bad deal for the consumer, and that nobody checked your ID at the vending machine, these devices have been relegated to the same fate as rotary phones, lava lamps, and fallout shelters. Then, in 1997, artist Clark Whittington of Winston-Salem, North Carolina used a recently-banned cigarette machine to put on a solo art show at a local cafe. The machine sold Whittington's black & white photographs for $1.00 each in cellophane-wrapped boxes. When time came to dismantle the show, the cafe owner asked to keep it up permanently. Space in the machine was opened for other artists. As of July 2018, there are over 100 Art-o-mat machines around the world with over 400 contributing artists*.
In this assignment, you are to create a class specification that simulates an Art-o-mat machine selling artistic works for three quarters each. For this assignment, you won't need to write the code that "drives" the machine -- that is provided for you. Instead, you'll write the class specification so that the provided driver code executes without modification. That is, you should use the driver code to provide clues about what is needed in your class specification.
A few notes about the way the Art-o-mat works:
when quarters are dropped into the machine, they go into a "hopper".
If a knob is pulled and there are not enough quarters in the hopper, nothing happens.
If a knob is pulled and there are enough (or more than enough) quarters in the hopper, then all the money in the hopper drops into the coin bin, and the product is dispensed.
no change is ever given by the machine.
the machine does not care if there are no products to dispense. It will still gladly take your money.
the number stored for the hopper as well as for the coin bin represents the number of quarters in each.
all items cost 3 quarters.
# write your class definition above this line # make no changes below this line def main(): photoMachine = Artomat(text1="Adams",text2="Arbus",text3="Dali",text4="Lange") portraitMachine = Artomat(money=212,hopper=2,bin1=1,bin2=0,bin3=8,bin4=10,text1="Picasso",text2="Rembrandt",text3="Van Gogh",text4="Monet") photoMachine.printStatus() photoMachine.dropQuarter() photoMachine.dropQuarter() photoMachine.dropQuarter() photoMachine.pullKnob(1) photoMachine.pullKnob(2) photoMachine.dropQuarter() photoMachine.pullKnob(2) photoMachine.dropQuarter() photoMachine.dropQuarter() photoMachine.dropQuarter() photoMachine.pullKnob(2) photoMachine.printStatus() photoMachine.restock() photoMachine.printStatus() print("----") portraitMachine.printStatus() portraitMachine.dropQuarter() portraitMachine.pullKnob(1) portraitMachine.printStatus() main() Once you write your specification and add it to the starter code, you should get output that closely matches the following:
1: 10 packs of Adams 2: 10 packs of Arbus 3: 10 packs of Dali 4: 10 packs of Lange There is $ 0.00 in the machine. There is $ 0.00 in the hopper. ching ching ching A pack of Adams slides into view. (nothing happens) ching (nothing happens) ching ching ching A pack of Arbus slides into view. 1: 9 packs of Adams 2: 9 packs of Arbus 3: 10 packs of Dali 4: 10 packs of Lange There is $ 1.75 in the machine. There is $ 0.00 in the hopper. A grouchy-looking attendent shows up, opens the back, fiddles around a bit, closes it, and leaves. 1: 10 packs of Adams 2: 10 packs of Arbus 3: 10 packs of Dali 4: 10 packs of Lange There is $ 0.00 in the machine. There is $ 0.00 in the hopper. ---- 1: 1 packs of Picasso 2: 0 packs of Rembrandt 3: 8 packs of Van Gogh 4: 10 packs of Monet There is $ 53.00 in the machine. There is $ 0.50 in the hopper. ching A pack of Picasso slides into view. 1: 0 packs of Picasso 2: 0 packs of Rembrandt 3: 8 packs of Van Gogh 4: 10 packs of Monet There is $ 53.75 in the machine. There is $ 0.00 in the hopper.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
