Posts

Post has attachment

A walkthrough describing the main steps needed to do problems 1~3 in pset 2. Intended for those less comfortable.

Add a comment...

Post has attachment

PSET 1 Tips (on strings and string manipulations, loops, conditionals)

Add a comment...

Post has attachment

Supplementary Tutorial - Object Oriented Programming

Add a comment...

Post has attachment

Supplementary Tutorial - Big O Notation

Add a comment...

Post has attachment

Supplemental Tutorial - Variable Scope

Add a comment...

Post has attachment

Supplemental Tutorial - Importing Modules and Indentation

Add a comment...

Post has attachment

Supplemental Tutorial - Dictionaries

Add a comment...

Post has attachment

Supplementary Tutorial - Tuples, Lists, Mutability

Add a comment...

Post has attachment

Supplemental Tutorial - Strings

Add a comment...

Post has attachment

The task is to implement the Rational class to represent a rational number with a numerator and a denominator. The methods of this class will be to implement + - * / and print (via

Some examples:

8/7 represented by Rational(8,7)

8/7 represented by StringRational('8/7')

3/1 represented by WholeNumber(3)

8/7 represented by MixedNumber(1,1,7) and this subclass should overload the

*_str_*) and also simplify() on a Rational number. To demonstrate inheritance, implement subclasses StringRational, WholeNumber, and MixedNumber.Some examples:

8/7 represented by Rational(8,7)

8/7 represented by StringRational('8/7')

3/1 represented by WholeNumber(3)

8/7 represented by MixedNumber(1,1,7) and this subclass should overload the

*_str_*method to print 1+1/7Add a comment...

Wait while more posts are being loaded