https://www.youtube.com/watch?v=sMBu20ZZwzE&t=401s
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("Dividend1 : " + dividend1 );
System.out.println("Dividend2 : " + dividend2 );
System.out.println("Dividend3 : " + dividend3 );
}
}
'생활코딩 > 생활코딩 Java' 카테고리의 다른 글
Java1_나의 앱 만들기_클래스 (0) | 2021.10.11 |
---|---|
Java1_나의 앱 만들기_Method (0) | 2021.10.11 |
Java1_나의 앱 만들기_반복문 (0) | 2021.10.11 |
Java1_나의 앱 만들기_조건문IF (0) | 2021.10.11 |
Java1_나의 앱 만들기 (0) | 2021.10.11 |