Question: class Mint :` A mint creates coins by stamping on years . The update method sets the mint's stamp to Mint .

class Mint :` " " " A mint creates coins by stamping on years . The update method sets the mint's stamp to Mint . current _ year . > > > mint = Mint ( ) > > > mint . year 2015 > > > dime = mint . create ( Dime ) > > > dime . year 2015 > > > Mint . current _ year = 2100 # Time passes* > > > nickel = mint . create ( Nickel )| > > > nickel . year * The mint has not updated its stamp yet 2015 > > > nickel . worth ( ) $ 5 cents + ( 85 - 50 years ) 40 > > > mint . update ( ) * The mint 's year is updated to 2100 > > > Mint . current _ year = 2175 # More time passes > > > mint . create ( Dime ) . worth ( ) # 10 cents + (75 - 50 years ) 35 > > > Mint ( ) . create ( Dime ) . worth ( ) # A new mint has the current year 10 dime . worth ( ) # 10 cents + ( 160 - 50 years ) 120 > > > Dime . cents = 20 # Upgrade all dimes !* > > > dime . worth ( ) # 20 cents + ( 160 - 50 years ) 130 11 11 1 current_ year = 2015 def. F _ init_ ( self) : self . update ( ) def create ( self , kind) : 11* * * YOUR CODE HERE\\ * * * * 1 1 def update ( self ) : 11* * * YOUR CODE HERE* * * !` class Coin :" def_ init_ ( self , year ) : self . year = year def worth ( self) : " The worth is a coin's face value + 1 cent for each year over age 50 . " 11* * * YOUR CODE HERE* * * *^ " lass Nickel ( coin ) :` cents = 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
