February 2017
Beginner
1056 pages
28h 57m
English
It is common sense to take a method and try it. If it fails, admit it frankly and try another. But above all, try something.
—FRANKLIN DELANO ROOSEVELT, Address at Oglethorpe University (MAY 22, 1932)
In this section we discuss some basic techniques that will help you to design, code, and test methods. We start with a case study.
If you have a variable of type double that stores some amount of money, your programs should display the amount in a nice format. However, you are likely to get output that looks like this:
Your cost, including tax, is $19.98123576432
Instead, we would like the output to look like this:
Your cost, including tax, is $19.98
In this case study, we will define a class called ...
Read now
Unlock full access