首页 > 其他分享 >数据结构课程设计

数据结构课程设计

时间:2023-02-10 18:12:14浏览次数:47  
标签:课程设计 null String JOptionPane static str 数据结构 public

数据结构课程设计

同步更新信息选择在推出程序后把各项信息写入文件中,

公司如果看求职者信息,可以看到全部的求职者信息,

没有用cmd窗口显示进程,用了JOptionPane.showMessageDialog弹窗来显示要进行的步骤

要先确定是求职者还是用人单位

package keshe;



import javax.annotation.processing.Filer;
import javax.swing.*;
import java.awt.*;
import java.io.*;

//同步更新文件,公司看求职者信息
public class she{
    //身份
    public static String ch="用人单位";
    public static String ch1="求职者";
    public static int num = 3;
    public static String me;
    public static int index = -1;
  public static BufferedReader br;
    public static BufferedReader bw;
 public static BufferedWriter bz;
    public static BufferedWriter bx;
 static {
     try{
         bz=new BufferedWriter(new FileWriter("d:"+File.separator+"test"+File.separator+"test3.txt"));
         bx=new BufferedWriter(new FileWriter("d:"+File.separator+"test"+File.separator+"test4.txt"));
     }catch(IOException e){
         e.printStackTrace();
     }

 }
    static {
        try {
            br = new BufferedReader(new FileReader("d:"+ File.separator+"test"+File.separator+"test.txt"));
            bw=new BufferedReader(new FileReader("d:"+File.separator+"test"+File.separator+"test2.txt"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        if (login() == false) {
            showstudent();
        } else {
         choice();

        }
    }
public static void logincompany(){
     String str=JOptionPane.showInputDialog(null,"请输入公司名称;");
     String str1=JOptionPane.showInputDialog(null,"请输入招聘岗位:");
     String str2=JOptionPane.showInputDialog(null,"请输入薪资待遇:");
     String s=str+str1+str2;
     String st;
     try{
         while((st= br.readLine())==null){
             bx.write(s);
         }
     }catch(IOException e){
         e.printStackTrace();
     }
     String str3=JOptionPane.showInputDialog(null,"是否查看求职者信息(y/n):");
     if(str3.equals("y")){
         showstudent();
     }else  System.exit(0);
}
    //登录
    public static boolean login() {
        String str2=JOptionPane.showInputDialog(null,"请输入你的身份:");
        if(str2.equals(ch1)) {
            for (int i = 2; i < 5; i++) {
                String str = JOptionPane.showInputDialog(null, "请输入姓名:");
                String str1 = JOptionPane.showInputDialog(null, "请输入密码:");
                String str3=JOptionPane.showInputDialog(null,"请输入向往薪资:");

                if (checkUser(str, str1,str3) != -1) {
                    String s="003"+str+str3;
                    String st;
                    me=s;
                    try{
                        while((st=bw.readLine())==null)
                           bz.write(s);
                    }catch (IOException e){
                        e.printStackTrace();
                    }
                     return true;
                 }
            }
        }else logincompany();
            return false;

    }
    public static void choice(){
        while (true) {
            String str = JOptionPane.showInputDialog(null, "请输入要进行的操作\n1.显示公司信息\n2." +
                    "显示本人信息\n3.查询审批状态\n4.修改本人信息\n5.删除本人信息\n6.退出");
            switch (str) {
                case "1":
                    showcompany();
                    break;
                case "2":
                    showme();
                    break;
                case "3":
                    checkstatus();
                    break;
                case "4":
                    change();
                    break;
                case"5":
                    delete();
                    break;
                case "6":
                    System.exit(0);
                    break;
                default:
                    JOptionPane.showMessageDialog(null, "请输入1-7");
                    break;
            }
        }
    }
    public static void checkstatus(){
     JOptionPane.showMessageDialog(null,"投递成功·正在审批中");
    }
public static void showme(){
     JOptionPane.showMessageDialog(null,me);
}
public static void change(){
    String str= JOptionPane.showInputDialog(null,"请输入你的姓名");
    String str1= JOptionPane.showInputDialog(null,"请输入你的向往薪资");
    me="003"+str+str1;
    showme();
}
public static void delete(){
     String str=JOptionPane.showInputDialog(null,"是否要删除信息(y/n):");
     String s=" ";
     if(str.equals("y")){
         me=s;
     }else  System.exit(0);
}
    //验证用户名
    public static int checkUser(String str, String str1,String str3) {
     if(str!=null&&str1!=null&&str3!=null)
         return 2;
//        for (int i = 0; i < admiArray.length; i++) {
//            if (str.equals(admiArray[i]) && str1.equals(codeArray[i])) {
//                index = i;
//                return i;
//            }
//        }
        return -1;
    }
    //显示求职者信息
    public static void showstudent() {
        String s = "学号  姓名  向往工资\n";
        String s1;

            try {
                while (((s1=bw.readLine())!=null)) {
                    s+=s1+"\n";
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        JOptionPane.showMessageDialog(null, s);
    }
    public static void showcompany() {
        String s;
        String s1="公司 招聘岗位 待遇 要求\n";
        while (true) {
            try {
                if (((s=br.readLine())!=null)){
                   s1+=s+"\n";
                }
                else break;

            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        JOptionPane.showMessageDialog(null, s1);
String str=JOptionPane.showInputDialog(null,"是否要头投递简历(y/n)");
if(str.equals("y")){
    tou();
}else{
    choice();
}

//        for (int i = 0; i < num - 1; i++) {
//            sortDaxiao(i);
//        }
//        show();
    }
    public static void tou(){
        while (true) {
            String str = JOptionPane.showInputDialog(null, "请输入要投递的公司\n1.腾讯\n2." +
                    "阿里\n3,退出\n");
            switch (str) {
                case "1":
                    checkstatus();
                    break;
                case "2":
                    checkstatus();
                    break;
                case "3":
                    System.exit(0);
                    break;
                default:
                    JOptionPane.showMessageDialog(null, "请输入1-7");
                    break;
            }
        }
    }


}

标签:课程设计,null,String,JOptionPane,static,str,数据结构,public
From: https://www.cnblogs.com/dfsdd/p/17109975.html