PRG 420 - Week 3 - Individual: Salesperson Java™ Application Part II
Total Compensation/build.xml
Builds, tests, and runs the project TotalCompensation.
Total Compensation/build/built-jar.properties
#Mon, 19 Dec 2016 18:36:48 -0600 F\:\\Total\ Compensation=
Total Compensation/build/classes/TotalCompensation/Salesperson_Salary.class
package TotalCompensation; synchronized class Salesperson_Salary { int fixedSalary; double commission; double totalComp; double salesTarget; double accelerationFactor; public void Salesperson_Salary(); void calculate_Commission(double); void calculate_Total_Compensation(); }
Total Compensation/build/classes/TotalCompensation/TotalCompensation.class
package TotalCompensation; public synchronized class TotalCompensation { public void TotalCompensation(); public static void main(String[]); }
Total Compensation/manifest.mf
Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build
Total Compensation/nbproject/build-impl.xml
Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url
Total Compensation/nbproject/genfiles.properties
build.xml.data.CRC32=91aea9c2 build.xml.script.CRC32=a1d039ff [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=91aea9c2 nbproject/build-impl.xml.script.CRC32=66654014 nbproject/[email protected]
Total Compensation/nbproject/private/private.properties
user.properties.file=C:\\Users\\Chuck\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
Total Compensation/nbproject/private/private.xml
file:/F:/Total%20Compensation/src/TotalCompensation/TotalCompensation.java
Total Compensation/nbproject/project.properties
annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # Files in build.classes.dir which should be excluded from distribution jar dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/TotalCompensation.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.external.vm=true javac.processorpath=\ ${javac.classpath} javac.source=1.8 javac.target=1.8 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=TotalCompensation.TotalCompensation manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test
Total Compensation/nbproject/project.xml
org.netbeans.modules.java.j2seproject TotalCompensation
Total Compensation/src/TotalCompensation/TotalCompensation.java
Total Compensation/src/TotalCompensation/TotalCompensation.java
/**
*
*
@author
Chuck Schwab
* University of Phoenix
* PRG420 Introduction to Java
* Week 3 Individual Assignment
*
*/
package
TotalCompensation
;
import
java
.
util
.
Scanner
;
public
class
TotalCompensation
{
/**
*
@param
args
* the command line arguments
*/
public
static
void
main
(
String
[]
args
)
{
double
totalSales
;
Salesperson_Salary
salesPersonSalary
=
new
Salesperson_Salary
();
/* This reads the users input values for annual sales */
Scanner
reader
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"\nEnter total Sales: "
);
totalSales
=
reader
.
nextDouble
();
/* This formats the total sales and compensation table and displays it */
System
.
out
.
format
(
"%-15s%30s %n"
,
"Total Sales"
,
"Total Compensation"
);
System
.
out
.
format
(
"%-15s%30s %n"
,
"==========="
,
"=================="
);
for
(
double
s
=
totalSales
;
s
<=
(
1.5
*
totalSales
);
s
+=
20000
)
{
/* This function is called to calculate the commission for the salesperson */
salesPersonSalary
.
calculate_Commission
(
s
);
/* This function is called to calculate the total compensation for the
salesperson */
salesPersonSalary
.
calculate_Total_Compensation
();
System
.
out
.
format
(
"%-15s%25s\n"
,
s
,
salesPersonSalary
.
totalComp
);
}
}
}
class
Salesperson_Salary
{
int
fixedSalary
;
double
commission
;
double
totalComp
;
double
salesTarget
=
150000
;
double
accelerationFactor
=
0.17
;
/* This is the constructor to initialize the default values */
public
Salesperson_Salary
()
{
fixedSalary
=
85000
;
commission
=
0
;
totalComp
=
fixedSalary
+
commission
;
}
/* This function is used to calculate the commission for the salesperson */
void
calculate_Commission
(
double
totalSales
)
{
/* The sales incentive will only start when 80% of the sales target is met */
if
(
totalSales
<
0.8
*
salesTarget
)
commission
=
0
;
/* This caculates the commission for totalSales <= the sales target but over 80% */
else
if
(
totalSales
<=
salesTarget
)
commission
=
0.15
*
totalSales
;
/* This calculates the totalSales with 15 % commission and an additional 2% */
else
commission
=
totalSales
*
accelerationFactor
;
}
/* This function is to calculate the total compensation for the salesperson */
void
calculate_Total_Compensation
()
{
totalComp
=
fixedSalary
+
commission
;
/* Total Compensation is sum of fixed salary and commission */
}
}