Initial Commit
This commit is contained in:
8
Source Code/Midterm/.idea/.gitignore
generated
vendored
Normal file
8
Source Code/Midterm/.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/../../../../../:\JavaProjects\JavaYear1\Midterm\.idea/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
25
Source Code/Midterm/.idea/codeStyles/Project.xml
generated
Normal file
25
Source Code/Midterm/.idea/codeStyles/Project.xml
generated
Normal file
@ -0,0 +1,25 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<JetCodeStyleSettings>
|
||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||
<value>
|
||||
<package name="java.util" alias="false" withSubpackages="false" />
|
||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
||||
<package name="io.ktor" alias="false" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PACKAGES_IMPORT_LAYOUT">
|
||||
<value>
|
||||
<package name="" alias="false" withSubpackages="true" />
|
||||
<package name="java" alias="false" withSubpackages="true" />
|
||||
<package name="javax" alias="false" withSubpackages="true" />
|
||||
<package name="kotlin" alias="false" withSubpackages="true" />
|
||||
<package name="" alias="true" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
</JetCodeStyleSettings>
|
||||
<ScalaCodeStyleSettings>
|
||||
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
|
||||
</ScalaCodeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
5
Source Code/Midterm/.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
Source Code/Midterm/.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
1
Source Code/Midterm/.idea/description.html
generated
Normal file
1
Source Code/Midterm/.idea/description.html
generated
Normal file
@ -0,0 +1 @@
|
||||
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
|
12
Source Code/Midterm/.idea/misc.xml
generated
Normal file
12
Source Code/Midterm/.idea/misc.xml
generated
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<entry_points version="2.0" />
|
||||
</component>
|
||||
<component name="ProjectKey">
|
||||
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
9
Source Code/Midterm/.idea/modules.xml
generated
Normal file
9
Source Code/Midterm/.idea/modules.xml
generated
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/untitled104.iml" filepath="$PROJECT_DIR$/untitled104.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
3
Source Code/Midterm/.idea/project-template.xml
generated
Normal file
3
Source Code/Midterm/.idea/project-template.xml
generated
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
|
||||
</template>
|
BIN
Source Code/Midterm/out/production/untitled104/FoodOrder.class
Normal file
BIN
Source Code/Midterm/out/production/untitled104/FoodOrder.class
Normal file
Binary file not shown.
BIN
Source Code/Midterm/out/production/untitled104/FoodVendor.class
Normal file
BIN
Source Code/Midterm/out/production/untitled104/FoodVendor.class
Normal file
Binary file not shown.
BIN
Source Code/Midterm/out/production/untitled104/Main.class
Normal file
BIN
Source Code/Midterm/out/production/untitled104/Main.class
Normal file
Binary file not shown.
36
Source Code/Midterm/src/FoodOrder.java
Normal file
36
Source Code/Midterm/src/FoodOrder.java
Normal file
@ -0,0 +1,36 @@
|
||||
public class FoodOrder {
|
||||
String foodOrdered;
|
||||
int zoneNumber;
|
||||
double foodCost;
|
||||
FoodVendor vendor;
|
||||
|
||||
public FoodOrder (String foodOrderedIn, int zoneNumberIn, double foodCostIn, FoodVendor vendorIn) {
|
||||
foodOrdered = foodOrderedIn;
|
||||
zoneNumber = zoneNumberIn;
|
||||
foodCost = foodCostIn;
|
||||
vendor = vendorIn;
|
||||
}
|
||||
public double getTotalCost() {
|
||||
if (vendor.isFreeDelivery()) {
|
||||
if (foodCost < 20.00) {
|
||||
if (vendor.getZone() == zoneNumber) {
|
||||
return (foodCost + (foodCost * 0.15));
|
||||
}
|
||||
else {
|
||||
return (foodCost + (foodCost*0.20));
|
||||
}
|
||||
}
|
||||
else {
|
||||
return foodCost;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (vendor.getZone() == zoneNumber) {
|
||||
return (foodCost + (foodCost * 0.15));
|
||||
}
|
||||
else {
|
||||
return (foodCost + (foodCost*0.20));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
26
Source Code/Midterm/src/FoodVendor.java
Normal file
26
Source Code/Midterm/src/FoodVendor.java
Normal file
@ -0,0 +1,26 @@
|
||||
public class FoodVendor {
|
||||
String cafeName;
|
||||
int zone;
|
||||
boolean freeDelivery;
|
||||
|
||||
public FoodVendor (String cafeNameIn, int zoneIn, boolean freeDeliveryIn) {
|
||||
cafeName = cafeNameIn;
|
||||
zone = zoneIn;
|
||||
freeDelivery = freeDeliveryIn;
|
||||
}
|
||||
public String getCafeName() {
|
||||
return cafeName;
|
||||
}
|
||||
|
||||
public int getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
public boolean isFreeDelivery() {
|
||||
return freeDelivery;
|
||||
}
|
||||
|
||||
public void setFreeDelivery(boolean freeDelivery) {
|
||||
this.freeDelivery = freeDelivery;
|
||||
}
|
||||
}
|
40
Source Code/Midterm/src/Main.java
Normal file
40
Source Code/Midterm/src/Main.java
Normal file
@ -0,0 +1,40 @@
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
boolean x = true;
|
||||
int i = -9;
|
||||
int j = 7;
|
||||
double d =4.8;
|
||||
String s = "is the";
|
||||
|
||||
if (!x) {
|
||||
System.out.print("MAy");
|
||||
}
|
||||
else {
|
||||
if ((j%2)==0){
|
||||
System.out.print("July");
|
||||
}
|
||||
else {
|
||||
System.out.print("OCtober");
|
||||
}
|
||||
}
|
||||
System.out.print(s);
|
||||
|
||||
if ((i>0 && j<0) || x) {
|
||||
System.out.print("nicest");
|
||||
}
|
||||
else if (j>0 && i<0) {
|
||||
System.out.print("best");
|
||||
}
|
||||
else {
|
||||
System.out.print("most aweseome");
|
||||
}
|
||||
|
||||
if (j>=5) {
|
||||
System.out.print(":");
|
||||
}
|
||||
else {
|
||||
System.out.print("<");
|
||||
}
|
||||
}
|
||||
}
|
12
Source Code/Midterm/untitled104.iml
Normal file
12
Source Code/Midterm/untitled104.iml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
Reference in New Issue
Block a user