diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..03f397c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a0eff58 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Data_and_operation/Casting.java b/Data_and_operation/Casting.java index 54f3811..941fef0 100644 --- a/Data_and_operation/Casting.java +++ b/Data_and_operation/Casting.java @@ -2,7 +2,7 @@ public class Casting { public static void main(String[] args) { - + double a = 1.1; double b = 1; double b2 = (double) 1; @@ -14,11 +14,9 @@ public static void main(String[] args) { int e = (int) 1.1; System.out.println(e); - // 1 to String + // 1 to String String f = Integer.toString(1); System.out.println(f.getClass()); - - } } diff --git a/Data_and_operation/Datatype.java b/Data_and_operation/Datatype.java index dc7a527..11e2b4d 100644 --- a/Data_and_operation/Datatype.java +++ b/Data_and_operation/Datatype.java @@ -2,21 +2,22 @@ public class Datatype{ public static void main(String[] args) { System.out.println(6); // Number System.out.println("six"); // String - + System.out.println("6"); // String 6 - - System.out.println(6+6); // 12 - System.out.println("6"+"6"); // 66 - - System.out.println(6*6); // 36 + + System.out.println(6 + 6); // 12 + System.out.println("6" + "6"); // 66 + + System.out.println(6 * 6); // 36 // System.out.println("6"*"6"); - + System.out.println("1111".length()); // 4 + // System.out.println(1111.length()); - + System.out.println("Hello World"); //String 문자열 System.out.println('H'); //Char 문자 System.out.println("H"); - + int i; } } \ No newline at end of file diff --git a/Data_and_operation/StringOperation.java b/Data_and_operation/StringOperation.java index f4c4dea..480d5b5 100644 --- a/Data_and_operation/StringOperation.java +++ b/Data_and_operation/StringOperation.java @@ -4,8 +4,6 @@ public class StringOperation { public static void main(String[] args) { System.out.println("Hello World".length()); // 11 - System.out.println("Hello, [[[name]]] ... bye. ".replace("[[[name]]]", "duru")); - + System.out.println("Hello, [[[name]]]. ".replace("[[[name]]]", "Lee seung hyun")); } - -} +} \ No newline at end of file diff --git a/HelloWorld_IOT/.settings/org.eclipse.jdt.core.prefs b/HelloWorld_IOT/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 021167a..0000000 --- a/HelloWorld_IOT/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=9 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=9 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=9 diff --git a/HelloWorld_IOT/HelloWorldRaspberryPi.java b/HelloWorld_IOT/HelloWorldRaspberryPi.java deleted file mode 100644 index c159e76..0000000 --- a/HelloWorld_IOT/HelloWorldRaspberryPi.java +++ /dev/null @@ -1,83 +0,0 @@ -import com.pi4j.io.gpio.GpioController; -import com.pi4j.io.gpio.GpioFactory; -import com.pi4j.io.gpio.GpioPinDigitalOutput; -import com.pi4j.io.gpio.PinState; -import com.pi4j.io.gpio.RaspiPin; - -public class HelloWorldRaspberryPi { - - public static void main(String[] args) throws InterruptedException { - - final GpioController gpio = GpioFactory.getInstance(); - final GpioPinDigitalOutput pin = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01, "PinLED", PinState.LOW); - final int SHORT_INTERVAL = 200; - final int LONG_INTERVAL = SHORT_INTERVAL * 3; - final int LETTER_INTERVAL = SHORT_INTERVAL * 7; - - while (true) { - // H - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(SHORT_INTERVAL); - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(SHORT_INTERVAL); - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(SHORT_INTERVAL); - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(LETTER_INTERVAL); - - // e - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(LETTER_INTERVAL); - - // l - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(SHORT_INTERVAL); - - pin.high(); - Thread.sleep(LONG_INTERVAL); - pin.low(); - Thread.sleep(SHORT_INTERVAL); - - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(SHORT_INTERVAL); - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(LONG_INTERVAL); - - // l - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(SHORT_INTERVAL); - - pin.high(); - Thread.sleep(LONG_INTERVAL); - pin.low(); - Thread.sleep(SHORT_INTERVAL); - - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(SHORT_INTERVAL); - pin.high(); - Thread.sleep(SHORT_INTERVAL); - pin.low(); - Thread.sleep(LONG_INTERVAL); - } - } -} diff --git a/MyApp/AccountingApp.java b/MyApp/AccountingApp.java deleted file mode 100644 index df9341e..0000000 --- a/MyApp/AccountingApp.java +++ /dev/null @@ -1,28 +0,0 @@ - -public class AccountingApp { - - public static void main(String[] args) { - - double valueOfSupply = Double.parseDouble(args[0]); - double vatRate = 0.1; - double expenseRate = 0.3; - double vat = valueOfSupply * vatRate; - double total = valueOfSupply + vat; - double expense = valueOfSupply * expenseRate; - double income = valueOfSupply - expense; - double dividend1 = income * 0.5; - double dividend2 = income * 0.3; - double dividend3 = income * 0.2; - - System.out.println("Value of supply : " + valueOfSupply); - System.out.println("VAT : " + vat); - System.out.println("Total : " + total); - System.out.println("Expense : " + expense); - System.out.println("Income : " + income); - System.out.println("Dividend 1 : " + dividend1); - System.out.println("Dividend 2 : " + dividend2); - System.out.println("Dividend 3 : " + dividend3); - - } - -} diff --git a/MyApp/AccountingArrayApp.java b/MyApp/AccountingArrayApp.java deleted file mode 100644 index 7c6da71..0000000 --- a/MyApp/AccountingArrayApp.java +++ /dev/null @@ -1,34 +0,0 @@ - -public class AccountingArrayApp { - - public static void main(String[] args) { - - double valueOfSupply = Double.parseDouble(args[0]); - double vatRate = 0.1; - double expenseRate = 0.3; - double vat = valueOfSupply * vatRate; - double total = valueOfSupply + vat; - double expense = valueOfSupply * expenseRate; - double income = valueOfSupply - expense; - - double[] dividendRates = new double[3]; - dividendRates[0] = 0.5; - dividendRates[1] = 0.3; - dividendRates[2] = 0.2; - - double dividend1 = income * dividendRates[0]; - double dividend2 = income * dividendRates[1]; - double dividend3 = income * dividendRates[2]; - - System.out.println("Value of supply : " + valueOfSupply); - System.out.println("VAT : " + vat); - System.out.println("Total : " + total); - System.out.println("Expense : " + expense); - System.out.println("Income : " + income); - System.out.println("Dividend 1 : " + dividend1); - System.out.println("Dividend 2 : " + dividend2); - System.out.println("Dividend 3 : " + dividend3); - - } - -} diff --git a/MyApp/AccountingArrayLoopApp.java b/MyApp/AccountingArrayLoopApp.java deleted file mode 100644 index 928212f..0000000 --- a/MyApp/AccountingArrayLoopApp.java +++ /dev/null @@ -1,37 +0,0 @@ - -public class AccountingArrayLoopApp { - - public static void main(String[] args) { - - double valueOfSupply = Double.parseDouble(args[0]); - double vatRate = 0.1; - double expenseRate = 0.3; - double vat = valueOfSupply * vatRate; - double total = valueOfSupply + vat; - double expense = valueOfSupply * expenseRate; - double income = valueOfSupply - expense; - - - - System.out.println("Value of supply : " + valueOfSupply); - System.out.println("VAT : " + vat); - System.out.println("Total : " + total); - System.out.println("Expense : " + expense); - System.out.println("Income : " + income); - - double[] dividendRates = new double[3]; - dividendRates[0] = 0.5; - dividendRates[1] = 0.3; - dividendRates[2] = 0.2; - - - int i = 0; - while(i < dividendRates.length) { - System.out.println("Dividend : " + (income*dividendRates[i]) ); - i = i + 1; - } - - - } - -} diff --git a/MyApp/AccountingClassApp.java b/MyApp/AccountingClassApp.java deleted file mode 100644 index e9d67ad..0000000 --- a/MyApp/AccountingClassApp.java +++ /dev/null @@ -1,70 +0,0 @@ -class Accounting{ - public double valueOfSupply; - public double vatRate; - public double expenseRate; - public void print() { - System.out.println("Value of supply : " + valueOfSupply); - System.out.println("VAT : " + getVAT()); - System.out.println("Total : " + getTotal()); - System.out.println("Expense : " + getExpense()); - System.out.println("Income : " + getIncome()); - System.out.println("Dividend 1 : " + getDiviend1()); - System.out.println("Dividend 2 : " + getDiviend2()); - System.out.println("Dividend 3 : " + getDiviend3()); - } - - public double getDiviend1() { - return getIncome() * 0.5; - } - public double getDiviend2() { - return getIncome() * 0.3; - } - public double getDiviend3() { - return getIncome() * 0.2; - } - - public double getIncome() { - return valueOfSupply - getExpense(); - } - - public double getExpense() { - return valueOfSupply * expenseRate; - } - - public double getTotal() { - return valueOfSupply + getVAT(); - } - - public double getVAT() { - return valueOfSupply * vatRate; - } -} -public class AccountingClassApp { - - public static void main(String[] args) { - // instance - Accounting a1 = new Accounting(); - a1.valueOfSupply = 10000.0; - a1.vatRate = 0.1; - a1.expenseRate = 0.3; - a1.print(); - - Accounting a2 = new Accounting(); - a2.valueOfSupply = 20000.0; - a2.vatRate = 0.05; - a2.expenseRate = 0.2; - a2.print(); - - a1.print(); - } -} - - - - - - - - - - diff --git a/MyApp/AccountingIFApp.java b/MyApp/AccountingIFApp.java deleted file mode 100644 index 6815644..0000000 --- a/MyApp/AccountingIFApp.java +++ /dev/null @@ -1,39 +0,0 @@ - -public class AccountingIFApp { - - public static void main(String[] args) { - - double valueOfSupply = Double.parseDouble(args[0]); - double vatRate = 0.1; - double expenseRate = 0.3; - double vat = valueOfSupply * vatRate; - double total = valueOfSupply + vat; - double expense = valueOfSupply * expenseRate; - double income = valueOfSupply - expense; - - double dividend1; - double dividend2; - double dividend3; - - if(income > 10000.0) { - dividend1 = income * 0.5; - dividend2 = income * 0.3; - dividend3 = income * 0.2; - } else { - dividend1 = income * 1.0; - dividend2 = income * 0; - dividend3 = income * 0; - } - - System.out.println("Value of supply : " + valueOfSupply); - System.out.println("VAT : " + vat); - System.out.println("Total : " + total); - System.out.println("Expense : " + expense); - System.out.println("Income : " + income); - System.out.println("Dividend 1 : " + dividend1); - System.out.println("Dividend 2 : " + dividend2); - System.out.println("Dividend 3 : " + dividend3); - - } - -} diff --git a/MyApp/AccountingIFUnder10000App.java b/MyApp/AccountingIFUnder10000App.java deleted file mode 100644 index ca27b14..0000000 --- a/MyApp/AccountingIFUnder10000App.java +++ /dev/null @@ -1,29 +0,0 @@ - -public class AccountingIFUnder10000App { - - public static void main(String[] args) { - - double valueOfSupply = Double.parseDouble(args[0]); - double vatRate = 0.1; - double expenseRate = 0.3; - double vat = valueOfSupply * vatRate; - double total = valueOfSupply + vat; - double expense = valueOfSupply * expenseRate; - double income = valueOfSupply - expense; - - double dividend1 = income * 1; - double dividend2 = income * 0; - double dividend3 = income * 0; - - System.out.println("Value of supply : " + valueOfSupply); - System.out.println("VAT : " + vat); - System.out.println("Total : " + total); - System.out.println("Expense : " + expense); - System.out.println("Income : " + income); - System.out.println("Dividend 1 : " + dividend1); - System.out.println("Dividend 2 : " + dividend2); - System.out.println("Dividend 3 : " + dividend3); - - } - -} diff --git a/MyApp/AccountingMethodApp.java b/MyApp/AccountingMethodApp.java deleted file mode 100644 index 09703ba..0000000 --- a/MyApp/AccountingMethodApp.java +++ /dev/null @@ -1,50 +0,0 @@ - -public class AccountingMethodApp { - public static double valueOfSupply; - public static double vatRate; - public static double expenseRate; - public static void main(String[] args) { - valueOfSupply = 10000.0; - vatRate = 0.1; - expenseRate = 0.3; - print(); - } - - public static void print() { - System.out.println("Value of supply : " + valueOfSupply); - System.out.println("VAT : " + getVAT()); - System.out.println("Total : " + getTotal()); - System.out.println("Expense : " + getExpense()); - System.out.println("Income : " + getIncome()); - System.out.println("Dividend 1 : " + getDiviend1()); - System.out.println("Dividend 2 : " + getDiviend2()); - System.out.println("Dividend 3 : " + getDiviend3()); - } - - public static double getDiviend1() { - return getIncome() * 0.5; - } - public static double getDiviend2() { - return getIncome() * 0.3; - } - public static double getDiviend3() { - return getIncome() * 0.2; - } - - public static double getIncome() { - return valueOfSupply - getExpense(); - } - - public static double getExpense() { - return valueOfSupply * expenseRate; - } - - public static double getTotal() { - return valueOfSupply + getVAT(); - } - - public static double getVAT() { - return valueOfSupply * vatRate; - } - -} diff --git a/Myapp/Myapp.iml b/Myapp/Myapp.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Myapp/Myapp.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Myapp/src/AccountingApp.java b/Myapp/src/AccountingApp.java new file mode 100644 index 0000000..88f747c --- /dev/null +++ b/Myapp/src/AccountingApp.java @@ -0,0 +1,23 @@ +public class AccountingApp { + + public static void main(String[] args){ + double value_of_supply = Double.parseDouble(args[0]); + double vat = value_of_supply * 0.1; + double total = value_of_supply + vat; + double expenseRate = 0.3; + double income = value_of_supply - value_of_supply * expenseRate; + double dividend1 = income * 0.5; + double dividend2 = income * 0.3; + double dividend3 = income * 0.2; + double expense = value_of_supply * expenseRate; + + System.out.println("Value of supply : "+ value_of_supply); + System.out.println("VAT : "+ vat); + System.out.println("Total : "+ total); + System.out.println("Expense : "+ expense); + System.out.println("Income : "+ income); + System.out.println("Dividend : "+ dividend1); + System.out.println("Dividend : "+ dividend2); + System.out.println("Dividend : "+ dividend3); + } +} \ No newline at end of file diff --git a/Myapp/src/AccountingAppArray.java b/Myapp/src/AccountingAppArray.java new file mode 100644 index 0000000..16d899e --- /dev/null +++ b/Myapp/src/AccountingAppArray.java @@ -0,0 +1,33 @@ +public class AccountingAppArray { + + public static void main(String[] args){ + double value_of_supply = Double.parseDouble(args[0]); + double vat = value_of_supply * 0.1; + double total = value_of_supply + vat; + double expenseRate = 0.3; + double income = value_of_supply - value_of_supply * expenseRate; + + double rate1=0.5; + double rate2=0.3; + double rate3=0.2; + + double[] dividendRates=new double[3]; + dividendRates[0]=0.5; + dividendRates[1]=0.3; + dividendRates[2]=0.2; + + double dividend1 = income * dividendRates[0]; + double dividend2 = income * dividendRates[1]; + double dividend3 = income * dividendRates[2]; + double expense = value_of_supply * expenseRate; + + System.out.println("Value of supply : "+ value_of_supply); + System.out.println("VAT : "+ vat); + System.out.println("Total : "+ total); + System.out.println("Expense : "+ expense); + System.out.println("Income : "+ income); + System.out.println("Dividend : "+ dividend1); + System.out.println("Dividend : "+ dividend2); + System.out.println("Dividend : "+ dividend3); + } +} \ No newline at end of file diff --git a/Myapp/src/AccountingAppArrayloop.java b/Myapp/src/AccountingAppArrayloop.java new file mode 100644 index 0000000..11ff99c --- /dev/null +++ b/Myapp/src/AccountingAppArrayloop.java @@ -0,0 +1,39 @@ +public class AccountingAppArrayloop { + + public static void main(String[] args){ + double value_of_supply = Double.parseDouble(args[0]); + double vat = value_of_supply * 0.1; + double total = value_of_supply + vat; + double expenseRate = 0.3; + double income = value_of_supply - value_of_supply * expenseRate; + + double rate1=0.5; + double rate2=0.3; + double rate3=0.2; + + double[] dividendRates=new double[3]; + dividendRates[0]=0.5; + dividendRates[1]=0.3; + dividendRates[2]=0.2; + + double dividend1 = income * dividendRates[0]; + double dividend2 = income * dividendRates[1]; + double dividend3 = income * dividendRates[2]; + double expense = value_of_supply * expenseRate; + + System.out.println("Value of supply : "+ value_of_supply); + System.out.println("VAT : "+ vat); + System.out.println("Total : "+ total); + System.out.println("Expense : "+ expense); + System.out.println("Income : "+ income); + System.out.println("Dividend : "+ dividend1); + System.out.println("Dividend : "+ dividend2); + System.out.println("Dividend : "+ dividend3); + + int i=0; + while (i10000.0) { + dividend1 = income * 0.5; + dividend2 = income * 0.3; + dividend3 = income * 0.2; + }else{ + dividend1 = income * 1; + dividend2 = income * 0; + dividend3 = income * 0; + } + + System.out.println("Value of supply : "+ value_of_supply); + System.out.println("VAT : "+ vat); + System.out.println("Total : "+ total); + System.out.println("Expense : "+ expense); + System.out.println("Income : "+ income); + System.out.println("Dividend : "+ dividend1); + System.out.println("Dividend : "+ dividend2); + System.out.println("Dividend : "+ dividend3); + } +} \ No newline at end of file diff --git a/Myapp/src/AccountingAppif10000.java b/Myapp/src/AccountingAppif10000.java new file mode 100644 index 0000000..b6e6dc0 --- /dev/null +++ b/Myapp/src/AccountingAppif10000.java @@ -0,0 +1,24 @@ +public class AccountingAppif10000 { + + public static void main(String[] args){ + double value_of_supply = Double.parseDouble(args[0]); + double vat = value_of_supply * 0.1; + double total = value_of_supply + vat; + double expenseRate = 0.3; + double income = value_of_supply - value_of_supply * expenseRate; + + double dividend1 = income * 1; + double dividend2 = income * 0; + double dividend3 = income * 0; + double expense = value_of_supply * expenseRate; + + System.out.println("Value of supply : "+ value_of_supply); + System.out.println("VAT : "+ vat); + System.out.println("Total : "+ total); + System.out.println("Expense : "+ expense); + System.out.println("Income : "+ income); + System.out.println("Dividend : "+ dividend1); + System.out.println("Dividend : "+ dividend2); + System.out.println("Dividend : "+ dividend3); + } +} \ No newline at end of file diff --git a/Myapp/src/AccountingClassApp.java b/Myapp/src/AccountingClassApp.java new file mode 100644 index 0000000..8d5c060 --- /dev/null +++ b/Myapp/src/AccountingClassApp.java @@ -0,0 +1,129 @@ +class Accounting{ + public static double value_of_supply; + public static double vatRate; + public static double expenseRate; + public static void print() { + System.out.println("Value of supply : "+ value_of_supply); + System.out.println("VAT : "+ getVat()); + System.out.println("Total : "+ getTotal()); + System.out.println("Expense : "+ getExpense()); + System.out.println("Income : "+ getIncome()); + System.out.println("Dividend : "+ getDividend1()); + System.out.println("Dividend : "+ getDividend2()); + System.out.println("Dividend : "+ getDividend3()); + } + + private static double getDividend1() { + return getIncome() * 0.5; + } + + private static double getDividend2() { + return getIncome() * 0.3; + } + + private static double getDividend3() { + return getIncome() * 0.2; + } + + private static double getExpense() { + return value_of_supply * expenseRate; + } + + private static double getIncome() { + return value_of_supply - value_of_supply * expenseRate; + } + + private static double getTotal() { + return value_of_supply + getVat(); + } + + private static double getVat() { + return value_of_supply * vatRate; + } +} +//class Accounting2{ +// public static double value_of_supply; +// public static double vatRate; +// public static double expenseRate; +// public static void print() { +// System.out.println("Value of supply : "+ value_of_supply); +// System.out.println("VAT : "+ getVat()); +// System.out.println("Total : "+ getTotal()); +// System.out.println("Expense : "+ getExpense()); +// System.out.println("Income : "+ getIncome()); +// System.out.println("Dividend : "+ getDividend1()); +// System.out.println("Dividend : "+ getDividend2()); +// System.out.println("Dividend : "+ getDividend3()); +// } +// +// private static double getDividend1() { +// return getIncome() * 0.5; +// } +// +// private static double getDividend2() { +// return getIncome() * 0.3; +// } +// +// private static double getDividend3() { +// return getIncome() * 0.2; +// } +// +// private static double getExpense() { +// return value_of_supply * expenseRate; +// } +// +// private static double getIncome() { +// return value_of_supply - value_of_supply * expenseRate; +// } +// +// private static double getTotal() { +// return value_of_supply + getVat(); +// } +// +// private static double getVat() { +// return value_of_supply * vatRate; +// } +//} +public class AccountingClassApp { + + public static void main(String[] args){ +// Accounting.value_of_supply=10000.0; +// Accounting.vatRate = 0.1; +// Accounting.expenseRate = 0.3; +// //... +// Accounting.print(); +// //... +// Accounting.value_of_supplu=20000.0; +// Accounting.vatRate=0.1; +// Accounting.expenseRate=0.3; +// Accounting.print(); +// // anotherVariable = ...; +// // anotherMethod= ...; +// Accounting1.value_of_supply=10000.0; +// Accounting1.vatRate = 0.1; +// Accounting1.expenseRate = 0.3; +// //... +// Accounting1.print(); +// //... +// Accounting2.value_of_supply=20000.0; +// Accounting2.vatRate=0.1; +// Accounting2.expenseRate=0.3; +// Accounting2.print(); +// // anotherVariable = ...; +// // anotherMethod= ...; + + // instance new를 붙혀서 생긴 복제 class를 instance + Accounting a1=new Accounting(); + a1.value_of_supply=10000.0; + a1.vatRate=0.1; + a1.expenseRate=0.3; + + Accounting a2=new Accounting(); + a2.value_of_supply=20000.0; + a2.vatRate=0.05; + a2.expenseRate=0.2; + + a1.print(); + a2.print(); + } +} \ No newline at end of file diff --git a/Myapp/src/AccountingMethodApp.java b/Myapp/src/AccountingMethodApp.java new file mode 100644 index 0000000..49fdb77 --- /dev/null +++ b/Myapp/src/AccountingMethodApp.java @@ -0,0 +1,52 @@ +public class AccountingMethodApp { + public static double value_of_supply; + private static double vatRate; + private static double expenseRate; + + public static void main(String[] args){ + value_of_supply=10000.0; + vatRate = 0.1; + expenseRate = 0.3; + print(); + } + + private static void print() { + System.out.println("Value of supply : "+ value_of_supply); + System.out.println("VAT : "+ getVat()); + System.out.println("Total : "+ getTotal()); + System.out.println("Expense : "+ getExpense()); + System.out.println("Income : "+ getIncome()); + System.out.println("Dividend : "+ getDividend1()); + System.out.println("Dividend : "+ getDividend2()); + System.out.println("Dividend : "+ getDividend3()); + } + + private static double getDividend1() { + return getIncome() * 0.5; + } + + private static double getDividend2() { + return getIncome() * 0.3; + } + + private static double getDividend3() { + return getIncome() * 0.2; + } + + private static double getExpense() { + return value_of_supply * expenseRate; + } + + + private static double getIncome() { + return value_of_supply - value_of_supply * expenseRate; + } + + private static double getTotal() { + return value_of_supply + getVat(); + } + + private static double getVat() { + return value_of_supply * vatRate; + } +} \ No newline at end of file diff --git a/Myapp/src/Main.java b/Myapp/src/Main.java new file mode 100644 index 0000000..3e59c38 --- /dev/null +++ b/Myapp/src/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/Programming/.idea/.gitignore b/Programming/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/Programming/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/Programming/.idea/misc.xml b/Programming/.idea/misc.xml new file mode 100644 index 0000000..432b646 --- /dev/null +++ b/Programming/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Programming/.idea/modules.xml b/Programming/.idea/modules.xml new file mode 100644 index 0000000..7db764f --- /dev/null +++ b/Programming/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Programming/.idea/vcs.xml b/Programming/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/Programming/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Programming/Programming.iml b/Programming/Programming.iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/Programming/Programming.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git "a/Programming/lib - \353\260\224\353\241\234 \352\260\200\352\270\260.lnk" "b/Programming/lib - \353\260\224\353\241\234 \352\260\200\352\270\260.lnk" new file mode 100644 index 0000000..7461ef3 Binary files /dev/null and "b/Programming/lib - \353\260\224\353\241\234 \352\260\200\352\270\260.lnk" differ diff --git a/java1.iml b/java1.iml new file mode 100644 index 0000000..bb659ac --- /dev/null +++ b/java1.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/java1/.gitignore b/out/production/java1/.gitignore new file mode 100644 index 0000000..1af1a20 --- /dev/null +++ b/out/production/java1/.gitignore @@ -0,0 +1 @@ +/letter.out.txt diff --git a/out/production/java1/.settings/.gitignore b/out/production/java1/.settings/.gitignore new file mode 100644 index 0000000..3b1537c --- /dev/null +++ b/out/production/java1/.settings/.gitignore @@ -0,0 +1 @@ +/org.eclipse.jdt.core.prefs diff --git a/out/production/java1/org/opentutorials/iot/.gitignore b/out/production/java1/org/opentutorials/iot/.gitignore new file mode 100644 index 0000000..38f478d --- /dev/null +++ b/out/production/java1/org/opentutorials/iot/.gitignore @@ -0,0 +1,9 @@ +/Aircon.class +/ColorDimmingLights.class +/DimmingLights.class +/Elevator.class +/Lighting.class +/OnOff.class +/Refrigerator.class +/Security.class +/Speaker.class