Results 1 to 3 of 3

Thread: ช่วยทีคับแนะนำการโปรแกรมคิดค่าโทรทีคับ

  1. #1


    คือ ให้เขียน โปรแกรมคิดค่าโทรศัพท์

    การคิดค่าโทรแบ่งเป็นช่วง
    06.01-18.00 >>>> 3 ฿
    18.01-22.00 >>>> 1.50 ฿
    22.01-06.00 >>>> 1 ฿

    รับค่าเริ่มต้นและสิ้นสุดผ่าน constructor ในรูป int
    int star_hr,int star_min
    int end_hr,int end_min

    ใช้งานโทรศัพท์ได้ไม่เกิน 24 ชม.


    ช่วย แนะนำทีคับว่าควรเขียนแนวไหนอ่ะคับ มึนๆ
    [SIZE=2][color=#FFFFFF]www.CitecClub.Org[/color][/SIZE] [/b] [/url]

    </div>

  2. #2
    Administrator asylu3's Avatar
    Join Date
    Jun 2000
    Location
    Thailand
    Posts
    3,557


    ก็ไม่ยากครับ
    1.สร้าง class ที่ด้านใน Constructor รับค่า param มาแล้วเอาไปสร้าง
    Obj time (ใช้ class ของ java ช่วย)

    2. เขียนเงื่อนไขดักไว้ด้วยว่่าเวลา start , end น้นเกิน 24 ชมไหม
    3. หลังจากนั้นก็เอาไปเข้าเงื่อนไขเวลา ว่าอยู่ในช่วงไหน
    4. ถ้าไม่ทำการคำณวนเวลาที่ใช้ไปในช่วงนั้นแล้วคิดเป็นเงินออกมา

    สำคัญคือ class ช่วยเรื่องเวลาจะต้องเอามันมาช่วยไม่งั้น ถ้าเขียนเองจะเสียเวลา

    http://java.sun.com/j2se/1.4.2/docs/...util/Date.html

    [code]


  3. #3


    คิคิ นอนเล่นหน้าคอมอยู่ดีๆคิดออกซะงั้น ^^
    [SIZE=2][color=#FFFFFF]www.CitecClub.Org[/color][/SIZE] [/b] [/url]

    </div>

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •