책 리뷰/생활코딩! 자바 프로그래밍 입문

7일차 - 나의 앱 만들기 1 (기본 기능 구현)

근성 2024. 1. 6. 00:42

부가세 계산하는 소스코드를 짜는것이다.

책에 나와있는데로 잘 작성했다.

public class AccountingApp {
    public static void main(String[] args){
        System.out.println("Value of supply : " + 12345.0);
        System.out.println("VAT : " + (12345.0 * 0.1));
        System.out.println("Total : " + (12345.0 + 12345.0 * 0.1));
        System.out.println("Expense : " + (12345.0 * 0.3));
        System.out.println("Income : " + (12345.0 - (12345.0 * 0.3)));
        System.out.println("Dividend 1 : " + (12345.0 - (12345.0 * 0.3)) * 0.5);
        System.out.println("Dividend 2 : " + (12345.0 - (12345.0 * 0.3)) * 0.3);
        System.out.println("Dividend 3 : " + (12345.0 - (12345.0 * 0.3)) * 0.2);

    }
}

12345.0이 원래는 10000.0이었는데,

IntelliJ(MacOS)에서는 command + shift + r 을 통해 replace all로 변경할 수 있다.