Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Page 1 of 2 12 LastLast
Results 1 to 25 of 26

Thread: plz help me with this.....plzz....

  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default plz help me with this.....plzz....

    im stuck and wondering how to do it...plz any1 help me....

    FERRY TICKETING SYSTEM

    A small ferry company has just purchased a computer for its new automated ticketing system. The company director has asked you to design the new system to assign seats for each trip of the 50-seater ferry, which covers the route from Penang to Langkawi and back daily. The upper deck of the ferry is reserved for business class passengers and can accommodate 10 people. The main deck of the ferry, the economy class can accommodate 40 people. Assume the company has at least 8 ferries - each with a different Ferry ID, which travel at one-hour intervals from 10 am to 5 pm daily.

    SECTION A : BASIC REQUIREMENTS OF THE SYSTEM

    1. Main Menu
    Your initial program design should display the following menu alternatives:

    FERRY TICKETING SYSTEM
    P – to Purchase Ticket
    V –to View Seating Arrangement
    Q – to Quit the system

    2. Submenu
    The following submenu will be displayed when P is selected:

    PURCHASING MODULE
    B – to purchase ticket for Business class
    E – to purchase ticket for Economy class
    M – to return to Main Menu

    3. Assigning Seats
    If the person types B, then your program should assign a seat in the business class (seats 1-10). If the person types E, then your program should assign a seat in the economy class (seats 11 - 50).

    4. Boarding Ticket
    Your program should then print a boarding ticket indicating the person’s name, seat number, whether it is in the business or economy class of the ferry, Date and time of departure, Source and Destination of the trip and Ferry ID.
    5. Seating Chart
    Use single-scripted array to represent the seating chart of the ferry, indicating the availability of the seats within each trip of the ferry. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of the array to 1 to indicate that the seat is no longer available. Your program should never assign a seat that has already been assigned.

    The Ferry ID will be requested when V is selected from the main menu and the seating arrangement for that ferry will be displayed in a tabular form, e.g.

    ************************************************** ***********
    * Ferry ID : 007 Date: 19 Sept 2005 *
    ************************************************** ***********
    * BUSINESS CLASS *
    ************************************************** ***********
    * 1 * 1 * 1 * 0 * 0 *
    ************************************************** ***********
    * 0 * 0 * 0 * 0 * 0 *
    ************************************************** ***********
    * ECONOMY CLASS *
    ************************************************** ***********
    * 1 * 1 * 1 * 1 * 1 *
    ************************************************** ***********
    * 1 * 1 * 1 * 1 * 1 *
    ************************************************** ***********
    * 0 * 0 * 0 * 0 * 0 *
    ************************************************** ***********
    * 0 * 0 * 0 * 0 * 0 *
    ************************************************** ***********
    * 0 * 0 * 0 * 0 * 0 *
    ************************************************** ***********
    * 0 * 0 * 0 * 0 * 0 *
    ************************************************** ***********
    * 0 * 0 * 0 * 0 * 0 *
    ************************************************** ***********
    * 0 * 0 * 0 * 0 * 0 *
    ************************************************** ***********

    6. Alternative seating
    When the business class is full, your program should ask the person if it is acceptable to be placed in the economy class (and vice versa). If yes, then make the appropriate seat assignment. If no, then print the message “Next trip leaves in 1 hour”.


    INSTRUCTIONS

    This is a group assignment. Each group should consist of between 2 – 3 members only. Upon submission of your assignment, you would be required to present your assignment at a date and time specified by your module lecturer.

    Each team member is required to contribute towards all sections of the assignment, present and explain his or her contribution of the work done. Each team member should also be able to answer questions posed with regards to the project and / or subject matter.

    DELIVERABLES

    You are required to submit:
    • A softcopy of the program coded in Java – submitted on a CD. The program should include the following:
    • Basic programming concepts such as displaying and reading of inputs, displaying of outputs, declaration of variables and assignment of values, comments – to explain various parts of the program, etc.
    • Using selection control structures and iteration structures, arrays,
    • Object-oriented concepts such as creation / use of classes / objects, inheritance, constructors
    • Use of exception handling, packages

    • Documentation of the system, that incorporates basic documentation standards such as header and footer, page numbering and which includes
    • Cover page
    • Table of contents
    • Workload matrix to indicate the contribution of each individual for each required component (shown in %age form) and signed off by each team member
    • Design of the program – using pseudo code or flowcharts – which adheres to the basic requirements listed above
    • Source code of the program in Java
    • Sample outputs when the program is executed with some explanation of the outputs / sections of the program
    • Additional features which have been incorporated in the solution in terms of design and Java
    • Assumptions
    • References


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: plz help me with this.....plzz....

    What code do you have so far and where exactly are you stuck?

    // Json

  3. #3
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    this is wat i did....but i cant run the program at all.....dono why and it keep on asking to locate afile jdk....i don know wat is it... and even my code does not work....
    and dono how to add the timing and date...



    import java.util.Scanner;         // to capture user input
        public class FerryTicketingSystem {
     
        public static void main(String[] args) {
           char selection;          // selection is a character 
           Scanner input = new Scanner(System.in);
           displayMenu();
           System.out.println("What is your selection? ");
           selection = input.next().charAt(0);       // character will be stored in this character 
           switch(selection)        // if the user selects p, it goes to the sub menu 
           {
           	   case 'p': case 'P':
           	   	   subMenu();
           	   	   char suboption;
           	   	   System.out.println("Make a class selection");           //print: functions to run on the same line , println: functions to run on the next line 
           	   	   suboption = input.next().charAt(0);	
           	   	   switch(subdoption)
           	   	   {
           	   	   	   case 'b': case 'B':
           	   	   	   	  //assign business class  
           	   	   	   break;
           	   	   	   case 'e': case 'E':
           	   	   	      //assign economic class
           	   	   	   break;
           	   	   	   case 'm': case 'M':
           	   	   	   	  displayMenu();            
           	   	   	   break;
           	   	   	   default:
           	   	   	   	   System.out.println("Wrong selection! Please enter the correct choice."); 
           	   	   }
           	   	break;
           	   	case 'q': case 'Q':
           	   		System.out.println("Good bye, Have a nice day!!");
           	   		System.exit(0);      // o is an example of arguments 
           	   	break;
           	   	default:
           	   	    System.out.println("Wrong selection!");
           	   	break; 
           }
        }
     
        public static void displayMenu()       // we must fix this problem where the system can run on repetition insteas of once only 
        {
        	System.out.println("*********************************************");
            System.out.println("*          FERRY TICKETING SYSTEM           *");
            System.out.println("*               *MAIN MENU*                 *");
            System.out.println("*           Select P for Sub Menu           *");
            System.out.println("*        Select Q to quit the system        *");
            System.out.println("*********************************************");  
        }
     
        public static void SubMenu() 
        {
        	System.out.println("*********************************************");
        	System.out.println("*           FERRY TICKETING SYSTEM          *");
        	System.out.println("*                 SUB MENU	                *");
        	System.out.println("*         Select B for Business Class       *");
        	System.out.println("*         Select E for Economic Class       *");
        	System.out.println("*           Select M for Main Menu          *");
        	System.out.println("*********************************************");
        }  
    }
    Last edited by Json; May 16th, 2010 at 05:14 AM. Reason: Please use code tags.

  4. #4
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    y i cant use my jcretor???

  5. #5
    Forum old-timer
    Join Date
    Nov 2008
    Location
    Faversham, Kent, UK
    Posts
    471
    My Mood
    Mellow
    Thanks
    4
    Thanked 58 Times in 54 Posts

    Default Re: plz help me with this.....plzz....

    If you could ask clear questions in normal English, it would help...

    If you get any error messages, copy and paste them here.

  6. #6
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    that is what i did...
    and my JCreator cannot run this code....
    and i need help to tell me how to make it as a do while condition....

  7. #7
    Member
    Join Date
    Jan 2010
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    i'm confused too haha, pasting your assignment specs here won't do~

  8. #8
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    ya true...wat 2 do then....

  9. #9
    Member
    Join Date
    Jan 2010
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    which ide are you using

  10. #10
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    not sure ....jus doin sumting
    ur done this b4???

  11. #11
    Member
    Join Date
    Jan 2010
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    oopg. yeah.
    hmm, you using netbeans,eclipse or what?

  12. #12
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    JCreator...can u help??? how to do the infinite loop??

  13. #13
    Member
    Join Date
    Jan 2010
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    LOL oh ok i din check the previous posts out. let me see

  14. #14
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    mm....10x....

  15. #15
    Member
    Join Date
    Jan 2010
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    ok paste the displayed errors shown in jcreator when you run that piece of code

  16. #16
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    import java.util.Scanner;
    public class FerryTicketingSystem {

    public static void main(String[] args) {
    char selection;
    Scanner input = new scanner.toUpperCase.();
    displayMenu();
    System.out.println("What is your selection? ");
    selection = input.next().charAt(0);
    switch(selection)
    {


    case 'P':
    subMenu();
    char suboption;
    System.out.println("Make a class selection");
    suboption = input.next().charAt(0);
    switch(suboption)


    case 'V':
    seatingArangement();
    char seating;
    seating = new int (50);
    switch(seating)



    {
    case 'B':

    break;
    case 'E':

    break;
    case 'M':
    displayMenu();
    break;
    default:
    System.out.println("Wrong selection! Please enter the correct choice.");
    }
    break;
    case 'Q':
    System.out.println("Good bye, Have a nice day!!");
    System.exit(0);
    break;
    default:
    System.out.println("Wrong selection!");
    break;
    }
    }


    public static void displayMenu()


    {
    System.out.println("****************************** ***************");
    System.out.println("* FERRY TICKETING SYSTEM *");
    System.out.println("* *MAIN MENU* *");
    System.out.println("* Select P for purchasing *");
    System.out.println("* Select v for view seatings *");
    System.out.println("* Select Q to quit the system *");
    System.out.println("****************************** ***************");
    }


    public static void subMenu()
    {
    System.out.println("****************************** ***************");
    System.out.println("* FERRY TICKETING SYSTEM *");
    System.out.println("* *SUB MENU* *");
    System.out.println("* Select B for Business Class *");
    System.out.println("* Select E for Economic Class *");
    System.out.println("* Select M for Main Menu *");
    System.out.println("****************************** ***************");
    }

    }

  17. #17
    Member
    Join Date
    Jan 2010
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    ok , run this. copy and paste what is shown on the console.

  18. #18
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    java:6: <identifier> expected
    Scanner input = new scanner.toUpperCase.();
    ^
    My Documents\FerryTicketingSystem.java:19: '{' expected
    switch(suboption)
    ^
    My Documents\FerryTicketingSystem.java:55: illegal start of expression
    public static void displayMenu()
    ^
    My Documents\FerryTicketingSystem.java:55: illegal start of expression
    public static void displayMenu()
    ^
    My Documents\FerryTicketingSystem.java:55: ';' expected
    public static void displayMenu()
    ^
    My Documents\FerryTicketingSystem.java:55: ';' expected
    public static void displayMenu()
    ^
    My Documents\FerryTicketingSystem.java:69: illegal start of expression
    public static void subMenu()
    ^
    My Documents\FerryTicketingSystem.java:69: illegal start of expression
    public static void subMenu()
    ^
    My Documents\FerryTicketingSystem.java:69: ';' expected
    public static void subMenu()
    ^
    My Documents\FerryTicketingSystem.java:69: ';' expected
    public static void subMenu()
    ^
    My Documents\FerryTicketingSystem.java:80: reached end of file while parsing
    }
    ^
    11 errors

  19. #19
    Member
    Join Date
    Jan 2010
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    switch(suboption){

  20. #20
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    10x alot....

  21. #21
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    can help me with loops???

  22. #22
    Forum old-timer
    Join Date
    Nov 2008
    Location
    Faversham, Kent, UK
    Posts
    471
    My Mood
    Mellow
    Thanks
    4
    Thanked 58 Times in 54 Posts

    Default Re: plz help me with this.....plzz....

    char seating;
    seating = new int(50);

    No way...

  23. #23
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    yap...i got tat...changed dy....now d ting can run.... now working on arrays...

  24. #24
    Forum old-timer
    Join Date
    Nov 2008
    Location
    Faversham, Kent, UK
    Posts
    471
    My Mood
    Mellow
    Thanks
    4
    Thanked 58 Times in 54 Posts

    Default Re: plz help me with this.....plzz....

    Quote Originally Posted by renny View Post
    yap...i got tat...changed dy....now d ting can run.... now working on arrays...
    Keyboard broken?

  25. #25
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: plz help me with this.....plzz....

    no sorry. just did not write properl.

Page 1 of 2 12 LastLast