-
Notifications
You must be signed in to change notification settings - Fork 48
AY2019 2020 Sem 2 Solutions
colintkn edited this page Nov 27, 2020
·
2 revisions
1
5
3
4
3
1
3
1
5
3
1
3
Account a1 = new Account("James");
Account a2 = new Account("William");
Transaction t = new Transaction(a1, a2, 37.3);
Bank b = new Bank();
b.doTransfer(t);
Addressee a = new Addressee("John". "13 Computing Drive");
Parcel p = new Parcel(a);
Courier c = new Courier(p);
Depot d = new Depot();
d.outForDelivery(c);
Library lib = new Library();
Book bk = new Book("Book Title", "Sam");
Borrower br = new Borrower("John", 1234);
lib.loanBook(bk, br)
public double calculateInterest(double balance, double rate) {
assert balance > 0 : "Insufficient balance";
assert rate >= 0 && rate <= 1.0 : "Wrong rate";
... Interest Calculation Code
assert result <= 50 && result >= 0: "Invalid interest";
}
Peer Learning
Codecrunch Contributions
Piazza Contributions
Wiki Contributions
Guides
Setting Up Checkstyle
Setting Up Java
Setting Up MacVim
Setting Up Sunfire
Setting Up Unix For Mac
Setting Up Unix For Windows
Setting Up Vim
Setting up SSH Config
CS2030 Contents
Lecture 1 SummaryCompile-run vs Run-time Summary
Quick Guide To Abstraction
Generics and Variance of Types
Comparable vs Comparator
Summary of completable future
CS2030S Notes
ELI5 Optional.map vs Optional.flatMap
PECS Example Code
Java Collection Framework (Iterator)
Generic
Generic Type Parameter and Generic Wildcard
Calculator
Lambda-Expression
Single Abstract Method (SAM)
Method Reference
Functional Interfaces 2
Simple Usage of Sandbox
Associative-but-not-commutative
Higher Order function
Functional Programming
Calculator With Functor
Eager Evaluation VS Lazy Evaluation
Simple Usage of Lazy Evaluation
Lazy Evaluation for LazyList
Lazy Evaluation for BinaryTree
Stream
Parallel Stream
Optional
Simple Usage of Stream
Asynchronous Programming
Notes on CompletableFuture
Notes on CompletableFuture 2
Simple Usage of CompletableFuture
Mind Map
Exception Handling
Links
CS2030 Java Style Guide
CS2030 Javadoc Specification
JDK 11 Download Link
JDK 11 API Docs
Codecrunch
Piazza Forum