• Post Reply Bookmark Topic Watch Topic
  • New Topic

Where to start this simple reservation program?  RSS feed

 
Robert Redman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm new to Java.
Recently registered for a degree in Software Engineering.
Just right after two weeks they gave me assignment without explaining or even held a class for the Java.
Anyhow I have to submit it on or before the deadline.

I have set of question to ask some Java nerds.

1) To run small java codes which one is better? servlets or java applets?
I am a (PHP) web developer.
So I prefer Java servlets which I can test easily using a webbrowser and during the viva I can submit my Java servlet URL link for reference.

2) Recommended editor for Java? Netbeans or notpad++ ?
Senior students are recommeding me Netbeans and I never worked in Netbeans before.
Always for my developemnt needs I use Notepad++

3)
Is it possible to create a small reservation system within a week when I do not have any prior experience in Java?
The assignment is:
Write a simple airline ticket reservation program.
The program should display a menu with the following options: reserve a ticket, cancel a reservation, check whether a ticket is reserved for a particular person, and display passengers.
The information is maintained on an alphabetized linked list of names.
In a simpler version of the program, assume that tickets are reserved for only one flight.
Create a linked list of flights with each node including a reference to a linked list of passengers.

I can do this easily in PHP but the requirment now is Java.

Please do suggestions
 
Liutauras Vilda
Marshal
Posts: 4657
319
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The assignment is:
Write a simple airline ticket reservation program.
The program should display a menu with the following options: reserve a ticket, cancel a reservation, check whether a ticket is reserved for a particular person, and display passengers.
The information is maintained on an alphabetized linked list of names.
In a simpler version of the program, assume that tickets are reserved for only one flight.
Create a linked list of flights with each node including a reference to a linked list of passengers.

I can do this easily in PHP but the requirment now is Java.

Welcome to the Ranch. I'd suggest to forget about the servlets, forget about any graphical user interface - it is not asked.

Start from the core what is in the quote.

I'd grab piece of paper and pencil and start drawing class diagram, needed attributes, methods - in this way you'd see whole view with whom you have to deal.

Have you ever wrote PHP code in OO way? What classes you'd think you need to have here?
 
Robert Redman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for thesuggestion.

Yes. I ever created OOP php.

I think
All the nouns can be classes: Airline, Flight, Ticket, Passenger. All the verbs can be methods: makeReservation(), bookTicket(), cancelTicket(), cancelFlight(), etc. An Airline has-a list of Flights. A Flight has-a list of Passengers.
 
Robert Redman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liutauras Vilda wrote:
I'd suggest to forget about the servlets, forget about any graphical user interface - it is not asked.


So how to run this system?
If it is in command prompt selecting menu will not be userfriendly.
Is there any specific software to compile and run the Java after we code it in Notepad++?
 
Liutauras Vilda
Marshal
Posts: 4657
319
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Robert Redman wrote:So how to run this system?
If it is in command prompt selecting menu will not be userfriendly.
Is there any specific software to compile and run the Java after we code it in Notepad++?

You mentioned earlier, that you have 1 week to accomplish assignment. Come up with the working functionality of program first, then, if you get some time left for your assignment, consider of having user friendly interface - but I don't see you have been asked to do so. What I learned from my experience on assignments - do not do the things you are not asked for.

So I'd concentrate on program model first, which provide console based program. Even tho if you were asked about the GUI's, you should leave that for later.

So you got some identified classes already, attributes, methods, try to implement them, see if you haven't missed anything.

Notepad++ should be enough to start. Compile and run your program you can from the command line, JDK includes Java compiler. Check this tutorial (<- link).
 
Dave Tolls
Rancher
Posts: 2914
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is cross posted at http://www.java-forums.org/new-java/95685-where-start-simple-reservation-program.html.
Where that quote in italics comes from.
 
Liutauras Vilda
Marshal
Posts: 4657
319
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Robert Redman, please read this FAQ (<- link), it is critical moment to follow.
 
Robert Redman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys sorry for that..
Actually I posted in one another forum before I posted in code ranch and java-forum.org but I did not get any reply even after 2 days.

So I've decided to post in coderanch and java-forum.org and take where ever I get a quick response.
But both forums are awesome.. responded faster than I expected.

Thanks guys..
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Robert Redman wrote:3)[/b] Is it possible to create a small reservation system within a week when I do not have any prior experience in Java?

I doubt it; but you could certainly lay the groundwork for it.

The main reason I say that is that the "visual side" is likely to take the most time, whether it's a Swing/FX-based GUI, or web-based screens. And if you need to persist any information - eg, in a database - that's another aspect you'll have to study.

I imagine that you could write a terminal-based mock-up of one as a "proof of concept" app in a week though.

The assignment is:
Write a simple airline ticket reservation program.
The program should display a menu with the following options: reserve a ticket, cancel a reservation, check whether a ticket is reserved for a particular person, and display passengers.
The information is maintained on an alphabetized linked list of names.
In a simpler version of the program, assume that tickets are reserved for only one flight.
Create a linked list of flights with each node including a reference to a linked list of passengers.

I have to admit, I don't particularly like those requirements because they're telling you not only what's needed, but how to do it - and that's supposed to be your job.

And from a modelling standpoint, I'm not wild about linking passengers directly with a flight.
To me, a Flight is probably synonymous with - or an instance of - an Aircraft (or AircraftType) and will have seats. Each Seat may be booked by a Ticket which specifies the Passenger; but it might also be empty.
A "passenger list" for a flight is therefore a view, not a linked list.

However, it's possible I'm overthinking this for a "simple" system. It has been known.

Winston
 
salvin francis
Bartender
Posts: 1612
36
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Robert Redman wrote:Just right after two weeks they gave me assignment without explaining or even held a class for the Java.

This is really really Odd. Why would someone do that ??

Robert Redman wrote:Anyhow I have to submit it on or before the deadline.

Which is bad since your prime attention would be completing the assignment "Anyhow" and you wont learn anything in the bargain.

Robert Redman wrote:
Write a simple airline ticket reservation program.
The program should display a menu with the following options: reserve a ticket, cancel a reservation, check whether a ticket is reserved for a particular person, and display passengers.
The information is maintained on an alphabetized linked list of names.
In a simpler version of the program, assume that tickets are reserved for only one flight.
Create a linked list of flights with each node including a reference to a linked list of passengers.


Here are a list of java topics that I think you should know before jumping into this pool ...
Arrays, Collections, loops, conditional statements, Objects and classes

Tutorial links :
https://docs.oracle.com/javase/tutorial/getStarted/cupojava/index.html

https://docs.oracle.com/javase/tutorial/java/nutsandbolts/index.html

https://docs.oracle.com/javase/tutorial/java/javaOO/index.html

https://docs.oracle.com/javase/tutorial/collections/index.html

If you are unsure about running a Java program ...
http://www.coderanch.com/t/659740/Wiki/create-Java-program
 
Dave Tolls
Rancher
Posts: 2914
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:And from a modelling standpoint, I'm not wild about linking passengers directly with a flight.
To me, a Flight is probably synonymous with - or an instance of - an Aircraft (or AircraftType) and will have seats. Each Seat may be booked by a Ticket which specifies the Passenger; but it might also be empty.
A "passenger list" for a flight is therefore a view, not a linked list.

However, it's possible I'm overthinking this for a "simple" system. It has been known.

Winston


Flights are a specific time and route, in most booking systems (I'd pull up the OTA specs, but they make my eyes bleed).
Aircraft can be assigned to a route, which will probably cover several flights (there and back etc), or maybe a round robin...depends.
And of course an Aircraft has a type associated with it.

So, essentially, a Flight is not an Aircraft. But it does need one to actually work...

Sorry...just where I happen to be working...
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:So, essentially, a Flight is not an Aircraft. But it does need one to actually work...
Sorry...just where I happen to be working...

No, all good stuff. In fact: have a cow.

I was actually thinking more of an "aircraft type" - ie, a template of the aeroplane that will actually fulfil the flight - so that reservation systems can do things like display seat plans and allow preferences for window or aisle seats.

Of course it can't be hard-coded, because one can easily imagine a flight that was scheduled to be an A380 having to be fulfilled by a couple of 340s or 777s; but I still reckon that the notion of a "Seat" is significant.

Ain't modelling fun?

Winston
 
Dave Tolls
Rancher
Posts: 2914
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
Ain't modelling fun?

Winston


Oh yes.
And things always end up being a lot more complex than they initially look.
The discovery of which is usually begun by the phrase "what about when (x)?"...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!