- เข้าสู่ระบบล่าสุด
- 2011-10-20
- เวลาออนไลน์
- 37 ชั่วโมง
- จิตพิศัย
- 64
- Money
- 51
- สมัครสมาชิกเมื่อ
- 2009-12-20
- สิทธิ์ในการอ่าน
- 200
- โพสต์
- 136
- กระทู้
- 45
- สำคัญ
- 0
- เครดิต
- 64
- UID
- 2
  
- Money
- 51
- จิตพิศัย
- 64
- สมัครสมาชิกเมื่อ
- 2009-12-20
- เครดิต
- 64
- โพสต์
- 136
|
ขาย vcd แผ่นละ 456 บาท ถ้าซื้อเกิน 5 ชิ้นจะได้รับส่วนลด 5% และถ้าเป็นสมาชิกด้วยจะได้รับส่วนลดอีก 5%
- Module VCD
- Dim qty, vcd As Integer
- Dim member As String
- Dim discount, sale, total As Decimal
- Sub Main()
- Console.WriteLine("How much VCD(s)?")
- qty = Console.ReadLine()
- Console.WriteLine("Member (y/n)?")
- member = Console.ReadLine()
- If qty > 5 AndAlso member = "y" Then
- vcd = 456
- sale = (vcd * 10) / 100
- discount = vcd - sale
- total = discount * qty
- Console.WriteLine("Discount = " & discount & " bath")
- Console.WriteLine("Total = " & total & " bath")
- ElseIf qty > 5 OrElse member = "y" Then
- vcd = 456
- sale = (vcd * 5) / 100
- discount = vcd - sale
- total = discount * qty
- Console.WriteLine("Discount = " & discount & " bath")
- Console.WriteLine("Total = " & total & " bath")
- Else
- vcd = 456
- discount = vcd
- total = discount * qty
- Console.WriteLine("Discount = " & discount & " bath")
- Console.WriteLine("Total = " & total & " bath")
- End If
- End Sub
- End Module
คัดลอกไปที่คลิปบอร์ด
ผันรันเมื่อซื้อเกิน 5 ชิ้นและเป็นสมาชิก
ผันรันเมื่อซื้อเกิน 5 ชิ้นแต่ไม่ได้เป็นสมาชิก
ผันรันเมื่อซื้อน้อยกว่า 5 ชิ้นแต่เป็นสมาชิก
ผันรันเมื่อซื้อน้อยกว่า 5 ชิ้นและไม่ได้เป็นสมาชิก
|
|