導航:首頁 > 編程語言 > java影院售票系統

java影院售票系統

發布時間:2022-08-04 09:19:34

Ⅰ 初學java, 在寫在線電影購票,想問下 怎麼實現買票選座位的功能

這個應該不難,定義一個行列的坐標系,用來標識每個座位,如果有座位的就標位1,沒有座位的就標位0,如果此座位票已售出,就設為99(或者其他也行),至於移動,刪除等其實就是改變整個坐標系的值了,然後通過圖形方式顯示出來,移動呀,刪除呀什麼的操作可以通過拖動等來實現,考慮到電影院中實際的前排與後排座位是有一定的錯開的,所以在繪制的時候,要考慮這個錯開距離,這樣就美觀了。

Ⅱ java編程:簡單的售票系統問題

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

Ⅲ 電影院售票的求大蝦們幫我做一個電影院售票系統(C#,java都行)CS或者BS結構都行 ,很急 請大蝦們幫幫忙

這是我以前寫的
#include<stdio.h>
#include<string.h>
#defineN99//票數容量

structDate
{
intyear;
intmonth;
intday;
};
structWord
{
charmovie[20];//片名
structDatetime;//上映日期
intprice;//票價
intspare;//剩餘票數
}a[N],t;

voidnewticket(FILE*fp)
{
printf("片名:");
scanf("%s",t.movie);
printf("日期:(例如2014125) ");
scanf("%d%d%d",&t.time.year,&t.time.month,&t.time.day);
printf("票價:");
scanf("%d",&t.price);
printf("剩餘票數:");
scanf("%d",&t.spare);
if(t.spare!=0)//余票不為0
fprintf(fp,"%-20s%4d-%02d-%02d%3d%3d ",t.movie,t.time.year,
t.time.month,t.time.day,t.price,t.spare);
fclose(fp);
}

voidlook(FILE*fp)
{
inti,n=0;
// charch;
fclose(fp);
fp=fopen("電影票.txt","r");
for(i=0;i<N;i++)
{
fscanf(fp,"%s%d-%d-%d%d%d ",a[i].movie,&a[i].time.year,
&a[i].time.month,&a[i].time.day,&a[i].price,&a[i].spare);
if(a[i].spare>0)n++;
}
for(i=0;i<n;i++)
printf("%-20s%4d-%02d-%02d%3d%3d ",a[i].movie,a[i].time.year,
a[i].time.month,a[i].time.day,a[i].price,a[i].spare);
fclose(fp);
}

voidmenu()
{
printf("========電影票管理系統======== ");
printf("1.添加售票2.余票查詢 0.退出程序 ");
printf("============================== ");
printf("功能選項:");
}

intmain()
{
FILE*fp;
charc;
while(1)
{
menu();
scanf("%c",&c);
fp=fopen("電影票.txt","a+");
switch(c)
{
case'1':newticket(fp);break;
case'2':look(fp);break;
case'0':return0;
}
}
}

Ⅳ 現在本人要用java的eclipse rcp 做一個影院售票系統的軟體,放映廳的座位,就是那種點一

給你個2個傳送門 先test 下 api 裡面的方法
http://www.apihome.cn/api/java/LabelView.html ----lable
http://www.itee.com/plang/java/javadiary/22.php ----二維數組

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

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; // 計數變數
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());

// 為按鈕添加監聽器

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 + "張票已售出" + " ");
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 + "張票已售出" + " ");
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 + "張票已售出" + " ");
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 + "張票已售出" + " ");
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 + "張票已售出" + " ");
try {
Thread.sleep(200);
} catch (InterruptedException e) {
// TODO 自動生成的 catch 塊
e.printStackTrace();
}
}

}

}

public static void main(String[] args) {
MultiThread multiThread = new MultiThread();

}

}

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

Ⅵ 誰有用java寫的電影院售票管理系統的代碼

您需要用簡潔明了的文字在這將疑惑描述清楚,讓回答者更好地了解您的困惑
比如您的問題還沒有敘述清晰,請點擊展開「問題補充」,
清楚描述您的疑惑,
,並能夠加入圖片來幫助回答者更加明了的知道你的疑惑,
更有針對性地幫助你。

我們可以針對你的需求提供一份適用於初學者的代碼,或學生版/個人版/專業版/企業版
您需要留下Email地址,以便回答者更好的解決你的問題
為獲取幫助,您可以發送消息到:六伍柒幺伍六幺五('幺'讀yao,一聲,'柒'同 '七'),QQ
您還可以通過向我們發起求助的方式主動去尋求我們的幫助。

如果您對回答不甚滿意,希望繼續對回答者進行追問了解詳情時,
可點擊回答內容下方的「繼續追問」按鈕
請您切記為您的問題選擇一個最恰當的分類,
因為只有這樣,您的問題才能在第一時間內得到正確解答。
交易提醒:預付訂金是詐騙

Ⅶ JAVA售票系統實時性怎麼解決

這個要去問專門搞JAVA售票系統的人士了!估計在這里網上找不到答案的。太專業了。懂的一兩句話也說不清的。

Ⅷ 用JAVA編寫一個售票系統

上面的幾位說的對啊,5分就要一個小型的系統,而且還是JAVA寫的,看來是想要B/S模式的了。

閱讀全文

與java影院售票系統相關的資料

熱點內容
java迭代器遍歷 瀏覽:301
閩政通無法請求伺服器是什麼 瀏覽:48
怎麼做積木解壓神器 瀏覽:203
王者榮耀解壓玩具抽獎 瀏覽:49
12位是由啥加密的 瀏覽:868
程序員編迷你世界代碼 瀏覽:895
php取現在時間 瀏覽:246
單片機高吸收 瀏覽:427
怎麼區分五代頭是不是加密噴頭 瀏覽:244
hunt測試伺服器是什麼意思 瀏覽:510
2013程序員考試 瀏覽:641
畢業論文是pdf 瀏覽:736
伺服器跑網心雲劃算嗎 瀏覽:471
單片機定時器計數初值的計算公式 瀏覽:801
win7控制台命令 瀏覽:567
貓咪成年app怎麼升級 瀏覽:692
360有沒有加密軟體 瀏覽:315
清除cisco交換機配置命令 瀏覽:751
華為刪除交換機配置命令 瀏覽:473
shell打包命令 瀏覽:827