atomicscala / atomic-scala-solutions Goto Github PK
View Code? Open in Web Editor NEWSolutions to the exercises in "Atomic Scala" 2nd Edition by Bruce Eckel & Dianne Marsh
Home Page: http://www.atomicscala.com
License: Other
Solutions to the exercises in "Atomic Scala" 2nd Edition by Bruce Eckel & Dianne Marsh
Home Page: http://www.atomicscala.com
License: Other
if(h < 0 || **(h==0 && m<0)**) {
new SimpleTime(0, 0)
}else if(m >= 0) {
new SimpleTime(h, m)
}
else new SimpleTime(h-1 ,60+m)
test:
val st4 = new SimpleTime(9, 30).subtract(new SimpleTime(9, 50))
st4.hours is 0
st4.minutes is 0
How is the "expected" variable in (result == expected) getting any value? If the "result" val is being made equal to "expected", where is expected picking up any value at all? very confusing
def test(x:Int, y:Double,
14 s:String, expected:Double):Unit = {
15 val result = addMultiply(x, y, s)
16 assert(result == expected,
17 "Expected " + expected +
18 " Got " + result)
19 println("result: " + result)
20 }
Hi,
I'm setting up scala on a mac. In the setup chapter of the ebook it says to
cd ~/AtomicScala/code
However, there is no subdirectory called code in the latest solutions download:
https://github.com/AtomicScala/atomic-scala-solutions/archive/master.zip
I can't seem to proceed with the CLASSPATH section of the Mac setup without this.
Thanks
Traits exercise 2 directions are to "Create a new class Toy". In the solution, a new trait Toy is created.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.