AD

Q&A 과제 도와주세여

요루6f145
2019-04-06 14:31:05 745 0 1

자바입니다


어느 회사에 근무하는 직원들을 저장하고 관리하기 위한 클래스를 생성하고,                                                                                  각 직원들의 신상 정보를 입력할 수 있는 프로그램을 작성하시오.                                                                                                          - 두개의 클래스 파일 생성: 

  *Employee: 직원 정보 관리 클래스

  * EmployeeTest: main() 함수가 있는 클래스

 - Employee 클래스 구현 내용

*나이 입력 함수: public void setAge(int age)* 직위 입력 함수: public void setPosition(String position)

*  이름 입력 함수: public void setName(String firstname, String lastname) - First name과 last name을 하나의 문자열 변수에 저장함 *월급 입력 함수:   한 명의 직원 정보 출력 함수: 

 - 이름, 나이, 직위, 월급 순으로 모두 출력 이름 출력 함수:  *월급 출력 함수:   *직위 출력 함수:

 - EmployeeTest 클래스 구현 내용  메뉴 출력 및 선택 메뉴에 대한 Employee 클래스의 함수 호출

  최대 4명의 직원 정보를 저장할 수 있도록 클래스 배열 사용  4명의 직원 정보는 사전에 입력하면 됨 (Employee 클래스 활용) 



이런 내용의 과제인데요. 배열에 정보를 어케 저장할지 모르겠구요. 지금까지 맞게 했는지도 모르겠어요.

5년만에 복학해서 기초가 없는데 졸업은 해야해서 억지로 듣고있는데 넘 어렵네요 ㅠ.ㅠ 살려주세요

import java.util.Scanner; 


class Employee{

    

    

    

    public void menu() {

        

                int select = 0;

            

                Scanner K = new Scanner(System.in);

                


            

                while(select!=5) {

                    

                    System.out.println("1.Display all positions");

                    System.out.println("2.Display all salaries");

                    System.out.println("3.Display all employees name");

                    System.out.println("4.Display all information");

                    System.out.println("0.Quit");

                    System.out.println("선택>>>");

                    select=K.nextInt();

                

                

                switch (select) {    // 조건

                case 0:        // 값 불일치(미실행)

                    System.out.println("종료합니다.");

                    return;

                case 1:        // 값 일치

                    AP(); // 실행

                    break; // 종료

                case 2:

                    System.out.println("2");

                    break;

                case 3:

                    System.out.println("3");

                    break;

                case 4:

                    System.out.println("4");

                    break;

                }

                }

            }

        

    int employeeAge;

    String employeePosition;

    String employeefirstname, employeelastname;

    int employeeSalary;

    

    public int getAge() {

        return employeeAge;

    }

    public void setAge(int age) {

        this.employeeAge= age;

    }

    public String getPosition() {

        return employeePosition;

    }

    public void setPosition(String Position) {

        this.employeePosition = Position;

    }

    public String getfirstname(String firstname) {

        return employeefirstname;

    }

    public String getlastname( String lastname) {

        return employeelastname;

    }

    public void    setfirstName(String firstname) {

        this.employeefirstname = firstname;

    }

    public void    setlastName(String lastname) {

        this.employeefirstname =lastname;

    }

    public int getSalary() {

        return employeeSalary;

    }

    public void setSalary(int salary) {

        this.employeeSalary=salary;

    }

    public void Employee(int age, String Position, String firstname, String lastname, int salary ) {

        this.employeeAge=age;

        this.employeePosition = Position;

        this.employeefirstname = firstname;

        this.employeefirstname =lastname;

        this.employeeSalary=salary;

    

    }

    

    public void AP() {

        System.out.println("position:" + getAge());

    }



                

    }




public class test {

    


    public static void main(String[] args) {

        

        int age[];

        age = new int [4];

        String[] firstname = new String[4];

        String[] lasttname = new String[4];

        int salary[];

        salary = new int[4];

        

        

        Employee employee = new Employee();

        employee.menu();

        }

    

    

        }

후원댓글 1
댓글 1개  
이전 댓글 더 보기
TWIP 잔액: 확인중
자유강의Q&A프로젝트 소개
3
04-11
»
04-06
2
Q&A
c언어 질문이요! [10]
딸랑짤랑
04-03
6
04-03
2
04-02
2
자유
프로그래밍을 하면 [4]
저탱이너무커서한타발림
04-01
2
자유
보안쪽으로 진로잡고 공부시작하려는데 [4]
앙기모띠주는나무띠
04-01
21
자유
백준의 새로운 서비스 [5]
겜잘스만구독함
04-01
9
03-31
1
03-28
1
자유
맥북 질문 [1]
최두식두부가게
03-27
3
03-26
2
자유
여러분들의 생각은? [6]
베일쿤
03-26
9
프로젝트 소개
GuiLocker- A wrapper of dislocker [1]
riemannulus
03-25
2
03-24
1
Q&A
쓰앵님... 알고리즘... [16]
RAnDi65535
03-23
2
Q&A
쓰앵님... 알고리즘... [10]
RAnDi65535
03-23
5
자유
쨔잔 [2]
고9마9웠어요ㅠ
03-22
23
03-22
4
자유
Visual Studio 퀄리티 실화? [1]
멘탈조각
03-22
1
자유
c언어 질문입니당 [8]
쿠킹호일사람되기
03-20
인기글 글 쓰기