[Tutor] Creating arbitrary number of destinations. (GUI program)

Alan Gauld alan.gauld at btinternet.com
Tue Dec 6 19:56:10 CET 2011


On 06/12/11 12:10, Mic wrote:
> Hi again :)
> First of all, I thought the topic name was correct. Arbitrary means as
> many as one would like or a realistic number right?

Yes, but its not clear what you mean by it.

> I have written a program where you can book train tickets. At first ,
> there were only a fixed number of seats availible to book, but I have
> now manged to create as many seats as I would like. That's nice.

Well done.

>  However, this was only for one destination. I want to be able
 > to have as many destinations as I want.
> The numbers of seats should be the same for every destination.

OK, How will this work.
One common technique for capturing these kinds of requirements is to 
write a "story" of how the user interacts with the system. (Sometimes 
called a "Usecase")

Imagine that the system exists, how would you describe the interaction?

Do it as a dialog, for example:

1 User logs into application
2 System presents welcome screen
3 User selects first destination from dropp down list
4 System presents seat chooser screen with available seats displayed
5 User selects seat(*)
6 System updates display
7 System displays price to user
8 User validates choice
9 System returns to home screen and confirms the booking
10 User selects next destination(*)
11 Repeat from step 4-9

5A Alternately user rejects all choices and cancels booking
10A Alternately user logs out.

By doing that it will be clearer how youi want the system to respond. At 
the moment we can only guess what you are thinking the system should do.

> I sat the entire evening and afternoon trying to get it to work
> yesterday, but I have no idea on how to accomplish this. I tried using
> for i in range() and while loops, without success sadly.

And I can't imagine what you were trying to do. Literally. I have no 
idea how this arbitrary number of destinations would be chosen by the 
user. One at a time, or many in one go? From a list, or typed at a prompt?

And what should the system do? Give the same seat for each trip? Or 
offer different seat booking screens per destination? You need to get 
the vision clear.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list