import java.io.*;
public class test02{
public static void main(String[] args)throws IOException
{
BufferedReader input = new BufferedReader
(new InputStreamReader(System.in));
char vip;
double money;
System.out.print("請輸入購買金額 :");
money = Double.parseDouble(input.readLine());
System.out.print("您是否為VIP (請輸入Y or N):" );
vip = (char)input.read();
if (Character.toUpperCase(vip)=='Y')
money=money*0.85;
else
money=money*0.95;
System.out.print("你消費者金額為 :" +money);
}
}
全站熱搜
留言列表