佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1141|回复: 7

object oriented programming

[复制链接]
发表于 26-7-2014 09:53 PM | 显示全部楼层 |阅读模式
下星期就交了。但我不会做>.<
等死的感觉,
我真的需要高手帮我做和教我做
本帖最后由 P.Tung 于 26-7-2014 09:54 PM 编辑

回复

使用道具 举报


ADVERTISEMENT

发表于 26-7-2014 09:57 PM | 显示全部楼层
請問, 重點是做什麼, 題目是甚麼
只是講OOP大家要幫也愛莫能助阿

回复

使用道具 举报

 楼主| 发表于 26-7-2014 10:12 PM | 显示全部楼层
musicalangel 发表于 26-7-2014 09:57 PM
請問, 重點是做什麼, 題目是甚麼
只是講OOP大家要幫也愛莫能助阿

System Requirements

  • Customer     Registration/Maintenance module
AirAsian has 2 types of Customer: Regular customer and Member customer. Allcustomers will need to provide their personal detail when they register as acustomer. Member customer will get 5% discount for total fees of every reservation.

  • Ticket     Reservation module
Only the registered customer can be reservedthe ticket. A regular customer can only make maximum two reservations, andMember customer can make maximum four reservations. Each reservation must be eithersingle or return trip. All customers can reserve up to four seats in eachreservation.
Max -main page
Schedule class get set
Rsv- toString, getLength

  • Query     module
User will able to request query as below:
-      Best sales destination
-      Top sale customer
-      Total reservation by eachcustomer
-      Others… (Bonus mark given ifstudent can provide useful query)

  • Bonus     module (optional)
Member customer who makes more than three reservations will be takepart in a lucky draw. The lucky draw should randomly pick one of the luckymember customer and display member customer’s name and total reservation she/hehad make.

回复

使用道具 举报

 楼主| 发表于 26-7-2014 10:14 PM | 显示全部楼层
我做的是reservation ..我不会做maximum..我开了 schedule class , reservation class...
schedule 我做getter and getter..
reservation 和 main page要做什么就不会了。
回复

使用道具 举报

发表于 26-7-2014 11:07 PM | 显示全部楼层
OK, 大致上題目我去看過了, 醜話先說在前面, 我不擅長OOP, 很多concept我還不是很懂, 講錯就見諒吧.

我覺得第一項你一定要創一個以customer 為中心的物件吧
例如
  1. class Customer
  2. {
  3.   string customer_name;
  4.   string customer_passport;

  5.   function set_customer_name($string)
  6.   {
  7.     ...
  8.   }

  9.   function get_customer_name($stirng)
  10.   {
  11.      ...
  12.   }
  13. }
复制代码
再來就是 extends 出2個物件, 分別是 member_customer 跟 regular_customer
這邊 member_customer 才來define 他們可以訂票數, regular_customer可以訂票的數量等
例如
  1. class member_customer extends customer
  2. {
  3.   int max_reservation=4;
  4.   ...
  5. }

  6. class regular_member extends member
  7. {
  8.   int max_reservation =2;
  9.   ...
  10. }
复制代码
這樣你的reservation->make_reservation()的時候, 就可以先以 member_customer->get_max_reservation()等method來得知他可以做多少次預訂.

希望可以幫助到你

如果有OO高手歡迎來踢爆.
回复

使用道具 举报

 楼主| 发表于 27-7-2014 12:08 AM | 显示全部楼层
musicalangel 发表于 26-7-2014 11:07 PM
OK, 大致上題目我去看過了, 醜話先說在前面, 我不擅長OOP, 很多concept我還不是很懂, 講錯就見諒吧.

我覺 ...

有帮到我了。。。谢谢你
但你可以写更完整给我更好。。啊哈哈
回复

使用道具 举报

Follow Us
发表于 27-7-2014 07:25 AM | 显示全部楼层
P.Tung 发表于 27-7-2014 12:08 AM
有帮到我了。。。谢谢你
但你可以写更完整给我更好。。啊哈哈

我想就做個啟發吧, 作業找槍手做我覺得不太好...

加油羅, 還有很多天Public holiday, 作的完的拉

有需要在提問.

回复

使用道具 举报

发表于 28-7-2014 09:58 PM | 显示全部楼层
Pm了,請檢查
回复

使用道具 举报


ADVERTISEMENT

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 28-8-2025 08:53 AM , Processed in 0.107400 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表