我想做一个名为“Ticketer”的简单程序,你可以:
我不确定如何正确设计类。
这是我到目前为止所得到的:
Class Event
----
Name
Date
QuantityOfTickets-which is how many tickets that event have
Class EventTicket extends Event
-----------
ticket[QuantityOfTickets]-after creatting any Event class create an array of tickets for
as many as we set up in Event class.
TicketNumber
Object Customer
+3 fields from Event (Event.Name,Event.Date and Event.QuantityOfTickets)
Class Customer
-------------
Id
FistName
LastName
请告诉我这是否是一个好的方法并指导我,一般来说,一步一步如何做这个程序?
谢谢
答案 0 :(得分:1)
我推荐另一种结构:
http://nameofapp.appspot.com/
Name
Date
QuantityOfTickets (can be removed and use instead of it length of array of tickets)
EventTicket tickets[QuantityOfTickets]
TicketNumber
(and if you will need additional fields (not from Event))
有关于它的任何问题吗?