我迫切需要最终项目的帮助 [英] Im in desperate need of help with final project

查看:79
本文介绍了我迫切需要最终项目的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

///这是我的java类的最终项目.这就是我应该做的::::::
//编写一个可用于预订飞机座位的程序.您可以使用三个算法构建块(顺序,选择和迭代).该航空公司有15排,每排有6个席位.第1至6行为商务舱,第7至15行为经济舱. "x"表示座位已预订; -"表示有空位.允许用户输入机票类型,所需的行号,所需的座位号等.然后应显示座位的可用性.
您的程序提示用户输入以下信息:
输入:
一个.机票类型:商务舱;经济舱
b.企业级所需的行号(1-6);经济舱(7-15)
C.期望的座位号(A-F):[/COLOR]
这是我到目前为止所拥有的

//this is my final project for my java class. This is what im supposed to do:::::
//Write a program that can be used for reserving airline seats. You can use three algorithm building blocks (Sequence, Selection, and Iteration). The airline has 15 rows, with 6 seats in each row. Rows 1 to 6 are business class, and rows 7 to 15 are economy class. " x" indicates that the seat has been reserved; "- " indicates that the seat is available. Allow the user to enter the ticket type, desired row number, desired seat number, and etc. It should then display seat availability.
Your program prompts the user to enter the following information:
INPUT:
a. Ticket type: business class ; economy class
b. Desired row number for busienss class (1-6); economy class(7-15)
c. Desired seat number (A - F):[/COLOR]
This is what i have so far

//PJ Eady
//Final project
// write a program that displays seat availability based on the user input
public class AirlineSeats
{
    public static void main(String[] args)
    {
        //initialize and declare variables, seats and matirx
        boolean[][] seats= new boolean [15][6];
        //create method calls and display blank seat chart
        initializeSeatChart(seats);
        displaySeatCharts(seats);
        //create a scanner object
        Scanner keyboard = new Scanner(System.in);
        while(availableSeats(seats)
        {
            //create method calls
            assignSeatType(seats);
            int seatNumber = seatSelection(seats);
            System.out.print("Do You want to receive another seat? " );
            //statements
            //if Yes print out the available seats s, otherwise exit the program
            // if ----- else statement 
        }
    }
    
    //create a method that represents open seats
    public static void initializeSeatChart(booleab[][] seatPlan)
    {
        //the nested loop that follows prints out the empty seat
        for(int i = 0; i<seatPlan.length; i++)
            for(int j = 0; j<seatPlan[0].length; j++)
                seatPlan[i][j] = ''-'';
    }
    // create a method that display the seating chart and able to 
    // see the seats occupied or not

    public static void DisplaySeatChart(boolean[] [] seatPlan)
    {
        //set up to 6 columns
        System.out.println("\t A B C\t D E F");
        //the nested loop that follows prints out the row number
        //and then check if each seat is occupied
        for()
        {
            //statements
            for()
                //statements
        }
    }

    //create a method and check if there is still a seat available
    public static boolean avalableSeat(boolean [][] seatPlan)
    {
        //the nested for loop searches for any empty seat
        //if it finds, it will stop and return true
        //statements
        return false;
    }

    //create a method that assign seat type and select the 
    //row numbers based on the user input
    public static void assignSeatType(boolean [] [] seatPlan)
    {
        //prompts the user for entering the ticket type
        //use switch statement: case 1 for business class 
        //and case 2 for economy class
        switch(ticketType)
        {
            //enter the row number(1 to 6)
            case 1:
                if
                else
                break;

            //enter the row number(7 - 15)
            case 2:
                if 
                else 
                break;
        }
    }

    //create a method that select the seat number (A-F) 
    //based on the user input
    public static int seatSelection()
    {
        //create a scanner object that will scan for the seat
        //prompts the user for a seat number
        //hold the string value entered and takes the first character
        //checks to see if it is within range of A(65) and F(70)
        //return te letter minus 65, which will bring it to a 
        //range of 0-5
    }
}



我对数组感到无所适从.被注释掉的部分是我无法弄清楚的部分.如果有人可以帮助您成为最好的朋友.



Im complety at a loss with arrays. the parts that are commented out are the parts i cant figure out. If anyone can help ill be your best friend.

推荐答案

语录:我对数组感到无所适从.被注释掉的部分是我无法弄清的部分.


那么,如果您有一个最终项目并且不了解数组,循环,而天哪知道其他事情,那么您整年都在做什么?如果我们为您编写了项目,那么您很可能会通过课程,但是那会证明什么呢?您需要与您的导师讨论此事,以查看是否有延迟您完成最终项目的机会.同时,我建议您记笔记并认真研究.
Quote: Im complety at a loss with arrays. the parts that are commented out are the parts i cant figure out.


So what have you been doing all year, if you have a final project and you don''t understand arrays, loops, and goodness knows what else? The chances are if we wrote your project for you you might pass your course, but what would that prove? You need to go and discuss this with your tutor to see if there''s a chance you could delay handing in your final project. In the meantime I suggest you get your notes out and do some serious studying.


这篇关于我迫切需要最终项目的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆