3 Replies - 574 Views - Last Post: 16 June 2009 - 12:10 PM Rate Topic: -----

#1 nathaniel8  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 6
  • Joined: 16-June 09

help plss array

Posted 16 June 2009 - 07:34 AM

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).



my group coding

public class Ferry_Ticketing_System {
	
	String destination = "d";
	String ferry_id = "id";
	int departure_time = "t";
	int BusinessClassSeatNo, EconomyClassSeatNo;
	String[] seats = new string[50];
	
	public string CheckBusinessSeat (){
		for (int i = 0; i < 10; i++){
			10[i]=i;
		BusinessClassSeatNo = i + 1;
		}
		for (int i = 10; i < seats.length; i++){
			seats[i]=i;
		EconomyClassSeatNo = i + 1;
		}
	}


nid guide pls

This post has been edited by nathaniel8: 16 June 2009 - 07:49 AM


Is This A Good Question/Topic? 1
  • +

Replies To: help plss array

#2 computerfox  Icon User is offline

  • straight vegetarian kid

Reputation: 49
  • View blog
  • Posts: 3,772
  • Joined: 29-January 09

Re: help plss array

Posted 16 June 2009 - 07:40 AM

please edit your post using [code ] and [/code ] thank you.

also, can you please show a little more code or can you make an attempt at the rest. looks like you just gave us that code so that you could get the rest from us, even though you're asking for our "guidance" .

This post has been edited by computerfox: 16 June 2009 - 07:42 AM

Was This Post Helpful? 0
  • +
  • -

#3 nathaniel8  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 6
  • Joined: 16-June 09

Re: help plss array

Posted 16 June 2009 - 07:50 AM

nono i dont mean to get rest of the code..
i nid guidance on my code...
i am confuse and not sure am i correct with the array
Was This Post Helpful? 0
  • +
  • -

#4 tanah.melayu  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 45
  • Joined: 21-February 09

Re: help plss array

Posted 16 June 2009 - 12:10 PM

View Postnathaniel8, on 16 Jun, 2009 - 06:34 AM, said:

my group coding

public class Ferry_Ticketing_System {
	
	String destination = "d";
	String ferry_id = "id";
	int departure_time = "t";
	int BusinessClassSeatNo, EconomyClassSeatNo;
	String[] seats = new string[50];
	
	public string CheckBusinessSeat (){
		for (int i = 0; i < 10; i++){
			10[i]=i;
		BusinessClassSeatNo = i + 1;
		}
		for (int i = 10; i < seats.length; i++){
			seats[i]=i;
		EconomyClassSeatNo = i + 1;
		}
	}



Hello nathaniel8,

actually, computerfox didn't mean the whole code will be given to you. :crazy: We are going to give you the best help we can. Now, this is your code... a part of it:

	public string CheckBusinessSeat (){
		for (int i = 0; i < 10; i++){
			10[i]=i;
		BusinessClassSeatNo = i + 1;
		}
		for (int i = 10; i < seats.length; i++){
			seats[i]=i;
		EconomyClassSeatNo = i + 1;
		}
	}


uurrmm... something wrong here: :blink:

10[i]=i;


i think, the '10' should be something else which must be the name of your array. That's all... ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1