본문 바로가기
java&eclipse 코딩 알고리즘/20231215

CustomerTest

by 몽상크리에이터 2023. 12. 15.

package com.tjoeun.customer;

 

public class CustomerTest {

 

public static void main(String[] args) {

 

// 일반 고객 객체 생성

Customer customerLee = new Customer();

System.out.println(customerLee);

customerLee.setCustomerID(10010);

customerLee.setCustomerName("이몽룡");

customerLee.setBonusPoint(1000);

System.out.println(customerLee);

 

System.out.println("회원 정보: " + customerLee.showCustomerInfo());

System.out.println("보너스 포인트: " + customerLee.calcBonus(10000));

System.out.println("누적 포너스 포인트: " + customerLee.calcPrice(10000));

System.out.println(customerLee);

System.out.println("====================================================");

 

// VIP 고객 객체 생성

VIPCustomer customerLim = new VIPCustomer();

System.out.println(customerLim);

customerLim.setCustomerID(50050);

customerLim.setCustomerName("임꺽정");

customerLim.setBonusPoint(10000);

customerLim.setAgentID(105);

System.out.println(customerLim);

System.out.println("회원 정보: " + customerLim.showCustomerInfo());

System.out.println("실제 구매 금액: " + customerLim.calcSales(10000));

System.out.println("보너스 포인트: " + customerLim.calcBonus(10000));

System.out.println("누적 포너스 포인트: " + customerLim.calcPrice(10000));

System.out.println(customerLim);

}

 

}

'java&eclipse 코딩 알고리즘 > 20231215' 카테고리의 다른 글

PolymorphismTest  (0) 2023.12.15
UpDownCastingTest  (0) 2023.12.15
VIPCustomer  (0) 2023.12.15
Customer  (0) 2023.12.15
ClassIncludeTest  (0) 2023.12.15