home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 December
/
PCWorld_1998-12_cd.iso
/
software
/
sybase
/
ASA
/
asa60.exe
/
data1.cab
/
jxmp_files
/
Invoice.java
< prev
next >
Wrap
Text File
|
1998-07-27
|
896b
|
34 lines
/****************************************************************/
/* Invoice class: for use with Adaptiver Server Anywhere */
/* documentation, chapter "Welcome to Java in the database" */
/****************************************************************/
public class Invoice {
//Fields
public String lineItem1Description;
public double lineItem1Cost;
public String lineItem2Description;
public double lineItem2Cost;
//An instance method
public double totalSum() {
double runningsum;
double taxfactor = 1 + Invoice.rateOfTaxation();
runningsum = lineItem1Cost + lineItem2Cost;
runningsum = runningsum * taxfactor;
return runningsum;
}
//A class method
public static double rateOfTaxation() {
double rate;
rate = .15;
return rate;
}
}