99偷拍视频精品区一区二,口述久久久久久久久久久久,国产精品夫妇激情啪发布,成人永久免费网站在线观看,国产精品高清免费在线,青青草在线观看视频观看,久久久久久国产一区,天天婷婷久久18禁,日韩动漫av在线播放直播

java汽車售票系統(tǒng)代碼 java汽車售票系統(tǒng)代碼查詢

求一個 java+mysql做的車站售票系統(tǒng),有數(shù)據庫的增刪改查就行了。要有完整的數(shù)據庫哦,謝謝~ 100分送上

你好,這個估計很少。理由如下:

成都創(chuàng)新互聯(lián)公司專注于東平企業(yè)網站建設,成都響應式網站建設公司,商城網站開發(fā)。東平網站建設公司,為東平等地區(qū)提供建站服務。全流程定制網站開發(fā),專業(yè)設計,全程項目跟蹤,成都創(chuàng)新互聯(lián)公司專業(yè)和態(tài)度為您提供的服務

1)這個用分難求,要用工程銀子,因為這個項目多數(shù)個人沒有,除非公司的東西,還得做這個項目的公司;

2)即使他公司有也不敢拿,違法且項目很大,部署很難;

3)即使以上都不考慮,個人為這個分數(shù)現(xiàn)開發(fā),那么也很費神,要設計數(shù)據庫。工作量不少。少,要一些人天工時。

java編程:簡單的售票系統(tǒng)問題

你的不是調試的問題 是錯 通過編譯了 但是你想實現(xiàn)的沒有 很多錯誤拋出了 。。。

求下題代碼,java題目。

Java程序:

import?java.io.IOException;

import?java.util.ArrayList;

import?java.util.List;

import?java.util.Scanner;

/**

*?汽車類

*/

class?Car?{

/**

?*?汽車編號

?*/

protected?int?id?=?0;

/**

?*?汽車款式

?*/

protected?String?type?=?null;

/**

?*?構造汽車對象

?*/

public?Car()?{

}

/**

?*?構造汽車對象

?*?@param?id?汽車編號

?*?@param?type?汽車款式

?*/

public?Car(int?id,?String?type)?{

this.id?=?id;

this.type?=?type;

}

/**

?*?獲得汽車編號

?*?@return?汽車編號

?*/

public?int?getId()?{

return?this.id;

}

/**

?*?獲得汽車款式

?*?@return?汽車款式

?*/

public?String?getType()?{

return?this.type;

}

}

/**

*?汽車銷售人員類

*/

class?Saler?{

/**

?*?姓名

?*/

protected?String?name?=?null;

public?ListCar?cars?=?new?ArrayListCar();

/**

?*?構造銷售汽車人員對象

?*/

public?Saler()?{

}

/**

?*?構造汽車銷售人員對象

?*?@param?name?姓名

?*/

public?Saler(String?name)?{

this.name?=?name;

}

/**

?*?獲得姓名

?*?@return?姓名

?*/

public?String?getName()?{

return?this.name;

}

}

public?class?Main?{

public?static?void?main(String[]?args)?{

Scanner?scan?=?new?Scanner(System.in);

ListCar?allCar?=?new?ArrayListCar(); //待售汽車對象的集合

allCar.add(new?Car(1001,?"凱越"));

allCar.add(new?Car(1002,?"凱越"));

allCar.add(new?Car(1003,?"凱越"));

allCar.add(new?Car(1004,?"凱越"));

allCar.add(new?Car(2001,?"君威"));

allCar.add(new?Car(2002,?"君威"));

allCar.add(new?Car(2003,?"君威"));

allCar.add(new?Car(2004,?"君威"));

allCar.add(new?Car(2005,?"君威"));

Saler?saler?=?new?Saler("張三其");

int?choice?=?0;

int?type; //銷售車型

int?num; //銷售數(shù)量

while(true)?{

System.out.println("請選擇銷售方式");

System.out.println("按車輛銷售:\t1");

System.out.println("按車型銷售:\t2");

System.out.println("查看銷售情況:\t3");

System.out.println("退出:\t\t0");

System.out.print("您的選擇:");

choice?=?scan.nextInt();

switch(choice)?{

case?0: //退出系統(tǒng)

System.out.println("退出系統(tǒng)");

System.exit(0);

break;

case?1: //按車輛銷售

for(Car?car?:?allCar)?{

if(!?exists(saler.cars,?car))?{

saler.cars.add(car);

System.out.printf("\t售出?%s?1?輛\n",?car.getType());

break;

}

}

break;

case?2: //按車型銷售

System.out.print("車型(凱越??0/君威??1):");

type?=?scan.nextInt();

System.out.print("銷售數(shù)量:");

num?=?scan.nextInt();

int?c?=?0; //實際銷售數(shù)量

for(Car?car?:?allCar)?{

if(c?=?num)?{

break;

}

if(car.getType().equals(type?==?0???"凱越"?:?"君威")??!?exists(saler.cars,?car))?{

saler.cars.add(car);

c++;

}

}

if(c??num)?{

System.out.printf("\t庫存不足,實際售出?%s?%d?輛\n",?type?==?0???"凱越"?:?"君威",?c);

}

else?{

System.out.printf("\t售出?%s?%d?輛\n",?type?==?0???"凱越"?:?"君威",?num);

}

break;

case?3: //查看銷售情況

System.out.println("\t當前銷售情況一覽");

System.out.printf("\t%10s%10s\n",?"汽車款式",?"汽車編號");

for(Car?car?:?saler.cars)?{

System.out.printf("\t%10s%10d\n",?car.getType(),?car.getId());

}

System.out.println("---------------------------");

System.out.printf("\t小計:\t%d?輛\n",?saler.cars.size());

break;

default:

break;

}

try?{

System.in.read();

}?catch?(IOException?e)?{

//?TODO?Auto-generated?catch?block

e.printStackTrace();

}

}

}

//判斷car在cars中是否存在

public?static?boolean?exists(ListCar?cars,?Car?car)?{

for(Car?c?:?cars)?{

if(c.getId()?==?car.getId())?{

return?true;

}

}

return?false;

}

}

運行測試:

請選擇銷售方式

按車輛銷售: 1

按車型銷售: 2

查看銷售情況: 3

退出: 0

您的選擇:1

售出?凱越?1?輛

請選擇銷售方式

按車輛銷售: 1

按車型銷售: 2

查看銷售情況: 3

退出: 0

您的選擇:2

車型(凱越??0/君威??1):0

銷售數(shù)量:3

售出?凱越?3?輛

請選擇銷售方式

按車輛銷售: 1

按車型銷售: 2

查看銷售情況: 3

退出: 0

您的選擇:3

當前銷售情況一覽

??汽車款式??????汽車編號

凱越??????1001

凱越??????1002

凱越??????1003

凱越??????1004

---------------------------

小計: 4?輛

請選擇銷售方式

按車輛銷售: 1

按車型銷售: 2

查看銷售情況: 3

退出: 0

您的選擇:0

退出系統(tǒng)

你好,請問一下java模擬5個窗口售票系統(tǒng)你是如何編寫的,能教我一下嗎?

package yaoshun.Thread;

import java.awt.Color;

import java.awt.Font;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JTextArea;

/*

* 多線程同步輸出

*/

public class MultiThread extends JFrame {

private int ticket; // 計數(shù)變量

private JButton jButton;

private JLabel jLabel;

private JLabel jLabel1;

private JLabel jLabel2;

private JLabel jLabel3;

private JLabel jLabel4;

private JLabel jLabel5;

private JTextArea jTextArea1;

private JTextArea jTextArea2;

private JTextArea jTextArea3;

private JTextArea jTextArea4;

private JTextArea jTextArea5;

private Thread thread1;

private Thread thread2;

private Thread thread3;

private Thread thread4;

private Thread thread5;

// 構造器

public MultiThread() {

setName("火車票銷售情況");

setLayout(null); // 使用絕對布局

setSize(680, 720);

setResizable(false); // 設置窗體大小不變

setLocationRelativeTo(null);// 設置窗體居中

jLabel = new JLabel("火車站售票大廳");

jLabel.setBounds(280, 20, 140, 30);

jLabel.setFont(new Font(getName(), Font.BOLD, 16)); // 設置字體大小

jLabel.setForeground(Color.BLUE); // 設置字體顏色

jLabel1 = new JLabel("售票窗1");

jLabel1.setBounds(72, 50, 80, 50);

jLabel1.setForeground(Color.red);

jLabel2 = new JLabel("售票窗2");

jLabel2.setBounds(192, 50, 80, 50);

jLabel2.setForeground(Color.red);

jLabel3 = new JLabel("售票窗3");

jLabel3.setBounds(312, 50, 80, 50);

jLabel3.setForeground(Color.red);

;

jLabel4 = new JLabel("售票窗4");

jLabel4.setBounds(432, 50, 80, 50);

jLabel4.setForeground(Color.red);

jLabel5 = new JLabel("售票窗5");

jLabel5.setBounds(552, 50, 80, 50);

jLabel5.setForeground(Color.red);

jTextArea1 = new JTextArea();

jTextArea1.setBounds(45, 100, 100, 500);

jTextArea1.setEditable(false); // 文本框不可編輯

jTextArea2 = new JTextArea();

jTextArea2.setBounds(165, 100, 100, 500);

jTextArea2.setEditable(false); // 文本框不可編輯

jTextArea3 = new JTextArea();

jTextArea3.setBounds(285, 100, 100, 500);

jTextArea3.setEditable(false); // 文本框不可編輯

jTextArea4 = new JTextArea();

jTextArea4.setBounds(405, 100, 100, 500);

jTextArea4.setEditable(false); // 文本框不可編輯

jTextArea5 = new JTextArea();

jTextArea5.setBounds(525, 100, 100, 500);

jTextArea5.setEditable(false); // 文本框不可編輯

jButton = new JButton("開始售票");

jButton.setBounds(270, 625, 140, 40);

jButton.setFont(new Font(getName(), Font.BOLD, 16));// 設置字體

jButton.setForeground(Color.blue);

thread1 = new Thread(new MyThread1());

thread2 = new Thread(new MyThread2());

thread3 = new Thread(new MyThread3());

thread4 = new Thread(new MyThread4());

thread5 = new Thread(new MyThread5());

// 為按鈕添加監(jiān)聽器

jButton.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

thread1.start();

thread2.start();

thread3.start();

thread4.start();

thread5.start();

}

});

add(jLabel);

add(jLabel1);

add(jLabel2);

add(jLabel3);

add(jLabel4);

add(jLabel5);

add(jTextArea1);

add(jTextArea2);

add(jTextArea3);

add(jTextArea4);

add(jTextArea5);

add(jButton);

setVisible(true); // 設置窗體顯示

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// 設置窗體關閉

}

class MyThread1 extends Thread {

// 重寫run方法

public synchronized void run() {

while (ticket 100) {

++ticket;

jTextArea1.append("第" + ticket + "張票已售出" + "\n");

try {

Thread.sleep(100);

} catch (InterruptedException e) {

// TODO 自動生成的 catch 塊

e.printStackTrace();

}

}

}

}

class MyThread2 extends Thread {

// 重寫run方法

public synchronized void run() {

while (ticket 100) {

++ticket;

jTextArea2.append("第" + ticket + "張票已售出" + "\n");

try {

Thread.sleep(100);

} catch (InterruptedException e) {

// TODO 自動生成的 catch 塊

e.printStackTrace();

}

}

}

}

class MyThread3 extends Thread {

// 重寫run方法

public synchronized void run() {

while (ticket 100) {

++ticket;

jTextArea3.append("第" + ticket + "張票已售出" + "\n");

try {

Thread.sleep(100);

} catch (InterruptedException e) {

// TODO 自動生成的 catch 塊

e.printStackTrace();

}

}

}

}

class MyThread4 extends Thread {

// 重寫run方法

public synchronized void run() {

while (ticket 100) {

++ticket;

jTextArea4.append("第" + ticket + "張票已售出" + "\n");

try {

Thread.sleep(100);

} catch (InterruptedException e) {

// TODO 自動生成的 catch 塊

e.printStackTrace();

}

}

}

}

class MyThread5 extends Thread {

// 重寫run方法

public synchronized void run() {

while (ticket 100) {

++ticket;

jTextArea5.append("第" + ticket + "張票已售出" + "\n");

try {

Thread.sleep(200);

} catch (InterruptedException e) {

// TODO 自動生成的 catch 塊

e.printStackTrace();

}

}

}

}

public static void main(String[] args) {

MultiThread multiThread = new MultiThread();

}

}

自己改一下 包名吧,這個題目是很多學校在多線程都用來的基礎練習題。

當前文章:java汽車售票系統(tǒng)代碼 java汽車售票系統(tǒng)代碼查詢
文章源于:http://www.yijiale78.com/article30/dohidso.html

成都網站建設公司_創(chuàng)新互聯(lián),為您提供、自適應網站、服務器托管云服務器、網站排名、微信公眾號

廣告

聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

網站托管運營