This document describes a Java project that builds, tests, and runs a sandwich order application. It includes the source code for the main IP3 class and Sub class. The IP3 class runs the application, which prompts the user to enter order details like name, address, beverage, bread type, sandwich type and size. It calculates the total cost and outputs the order details. The Sub class defines the object used to store each order details.
IP3build.xml Builds, tests, and runs the project IP3..docx
1. IP3/build.xml
Builds, tests, and runs the project IP3.
IP3/build/classes/.netbeans_automatic_build
IP3/build/classes/.netbeans_update_resources
IP3/build/classes/ip3/IP3.classpackage ip3;
publicsynchronizedclass IP3 extends Sub {
public void IP3();
publicstatic void main(String[]);
}
IP3/build/classes/ip3/Sub.classpackage ip3;
publicsynchronizedclass Sub {
private String name;
private String address;
private String beverage;
private String bread;
private String type;
private String size;
public void Sub();
public void Sub(String, String);
public String getName();
public void setName(String);
public String getAddress();
public void setAddress(String);
public String getBeverage();
2. public void setBeverage(String);
public String getBread();
public void setBread(String);
public String getType();
public void setType(String);
public String getSize();
public void setSize(String);
}
IP3/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
IP3/nbproject/build-impl.xml
3.
4.
5.
6.
7.
8. 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
29. To run this application from the command line without
Ant, try:
java -jar "${dist.jar.resolved}"
30. Must select one file in the IDE or set run.class
Must select one file in the IDE or set run.class
31. 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.
32. 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.
33. Must select one file in the IDE or set run.class
Must select some files in the IDE or set test.includes
34. Must select one file in the IDE or set run.class
Must select one file in the IDE or set applet.url
35.
36. 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
37. 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
40. # 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=379c7270
nbproject/build-impl.xml.script.CRC32=43f0144f
nbproject/[email protected]
IP3/nbproject/private/private.properties
compile.on.save=true
user.properties.file=C:UsersPeteAppDataRoamingNetBe
ans8.0.2build.properties
IP3/nbproject/private/private.xml
IP3/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
41. 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=
42. # This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/IP3.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.processorpath=
${javac.classpath}
javac.source=1.7
javac.target=1.7
javac.test.classpath=
${javac.classpath}:
${build.classes.dir}
44. 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
IP3/nbproject/project.xml
org.netbeans.modules.java.j2seproject
45. IP3
IP3/src/ip3/IP3.javaIP3/src/ip3/IP3.java/*
* To change this license header, choose License Headers in Pro
ject Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ip3;
import java.util.ArrayList;
import javax.swing.JOptionPane;
/**
*
* @author Pete
*/
publicclass IP3 extendsSub{
/**
* @param args the command line arguments
*/
publicstaticvoid main(String[] args){
ArrayList<Sub> subList =newArrayList<Sub>();
double totalCost =0;
46. double ordersCost =0;
String drinkType ="Select Beverage:"
+"nEnter 1 for Coke"
+"nEnter 2 for Bottled Water"
+"nEnter 3 for Coffee"
+"nEnter 4 for Milkshake";
String bType ="Select Bread:"
+"nEnter 1 for Whole Wheat"
+"nEnter 2 for White Bread"
+"nEnter 3 for Italian Bread";
String sType ="Select Sandwich Type:"
+"nEnter 1 for BLT"
+"nEnter 2 for Italian Combo"
+"nEnter 3 for Vegetarian"
+"nenter 4 for Eggplant Parm";
String name =JOptionPane.showInputDialog("Enter Your Name
");
String address =JOptionPane.showInputDialog("Enter Your Add
ress");
String welcomeMsg ="Welcome "+ name +" ton"+"Famous Fav
orite Subsn";
String choice ="Y";
String output ="";
while("Y".equalsIgnoreCase(choice)){
int drinkTypeInt =Integer.parseInt(JOptionPane.showInputDialo
g(drinkType));
String beverage ="";
if(drinkTypeInt ==1){
beverage ="Coke";
totalCost = totalCost +1;
}elseif(drinkTypeInt ==2){
beverage ="Bottle Water";
}elseif(drinkTypeInt ==3){