Rational

A class for rational numbers, and starting point for learning Java, and the Java toolchain

On website: https://ucsb-cs56-pconrad.github.io/tutorials/rational/

Based on https://github.com/UCSB-CS56-M16/cs56-rational-example

This is a set of tutorial examples of a class for Rational Numbers.

It illustrates various concepts/techinques of Java Coding (a list of these appears below.)

These examples are intended as support for a course in which there are also reading assignments and lectures; this tutorial is not intended to be a stand-alone curriculum for learning Java.

Having said that, if you follow the code examples in order, and look up the concepts that are new to you at each step, that will probably go a long way towards learning some important basic concepts of Java programming.

Link to javadocs: http://ucsb-cs56-m16.github.io/cs56-rational-example

Rational tutorials: table of contents

Section Code
(github repo)
Topics Covered
Rational: ex01 code private data members, public constructors, integers from command line arguments, main methods, built in toString method, simple compilation/execution with javac/java
Rational: ex02 code toString method, public getters, simple build.xml file for Ant, mutiple classes with main() in a single project
Rational: ex03 code creating a jar file, automatic testing with junit, creating and publishing javadoc
Rational: ex04 code move source to /src and .class files to /build, adjustments to Ant build.xml, discuss immutable objects
Rational: ex05 code Addressing bugs with test-driven development (expose bug with test first, then make test pass to squash bug)
Rational: ex06 code understanding inheritance (from java.lang.Object), linking from our javadoc to Java standard libraries, negative rational numbers, multiplying rational numbers
Rational: ex07 code Exceptions, testing for Exceptions with JUnit
Rational: ex08 code functions (methods) to multiply two rational numbers
Rational: ex09 code == vs. .equals, hashCode()
Rational: ex10 code packages: edu.ucsb.cs56.pconrad.rational
Rational: ex11 code Using java arrays and java.util.ArrayList with Rational; running main() programs from a jar file; reading from file, constructing from string
Rational: ex12 code Converting from Ant to Maven, adding jacoco test case coverage
Rational: ex13 code Improved test case coverage
Rational: ex14 code Java Lambdas
Rational: ex15 code Sorting: Comparable, Comparators
On website: https://ucsb-cs56-pconrad.github.io/tutorials/rational/