Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions