1 / 16

팀 프로젝트 2

팀 프로젝트 2. 팀명 : CJ 팀 원 : 김주호 , 이창오. 0. 목차. 1. 요구사항 2. 설계. 1. 요구사항. 1. 데이터 추가. 구조체 포인터를 만들어 malloc 으로 31 개의 구조체가 들어갈 메모리를 할당한다 .( 최대 30 명이니 30 명이 들어갔을 때 마지막 주소 값이 NULL 인 부분을 찾기 위해 크기를 31 로 잡는다 .) 인원수 이외의 메모리에는 NULL 값으로 초기화 한다 . 총 학생수를 불러와서 그 뒤 NULL 값인 곳을 알아낸다 .

coye
Télécharger la présentation

팀 프로젝트 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 팀 프로젝트 2 팀명: CJ 팀원 : 김주호, 이창오

  2. 0.목차 • 1. 요구사항 • 2. 설계

  3. 1. 요구사항

  4. 1. 데이터 추가 • 구조체 포인터를 만들어 malloc으로 31개의 구조체가 들어갈 메모리를 할당한다.(최대 30명이니 30명이 들어갔을 때 마지막 주소 값이 NULL인 부분을 찾기 위해 크기를 31로 잡는다.) • 인원수 이외의 메모리에는 NULL 값으로 초기화 한다. • 총 학생수를 불러와서 그 뒤 NULL값인 곳을 알아낸다. • 받아올 매개변수는 학생수, 구조체 포인터이다.

  5. 2. 데이터 삭제 • 총 학생수를 불러와서 변수에 저장한다. • 삭제할 데이터의 학번을 받아와서 그 학번에 해당하는 index를 찾는다. • 그 index를 NULL 값으로 만들고 총 학생수에 해당하는 index에 있는 데이터의 주소를 삭제한 곳으로 옮긴후 옮기기 전의 주소 값은 NULL로 초기화 한다. • 받아올 매개변수는 학번, 구조체 포인터이다.

  6. 3. 데이터 수정 • 학번, 바꾸고자 하는 항목에 해당하는 번호, 바꾸고 난 후의 점수를 매개변수로 받아온다. • 그 학번에 해당하는 index를 찾고 switch 문으로 case를 나눈다. 그 case에 해당하는 번호를 위에 받아온 매개변수중 바꾸고자 하는 항목에 해당하는 번호와 일치시켜 데이터를 바꿔준다. • 1을 받아왔으면 중간고사 점수, 2를 받아왔으면 기말고사 점수를 바꾸면 된다.

  7. 4. 데이터 정렬 • 내림차순, 오름차순 함수를 따로 만든다. • 내림차순 함수에서 받아올 매개변수는 정렬할 항목에 대한 번호와 구조체 포인터이다. • 위와 같이 항목별로 switch문을 돌려서 각 case에 해당하는 항목에 대해 정렬할 것이다. • 선택정렬또는 버블정렬 • 오름차순 함수도 마찬가지이다.

  8. 5. 성적산출 • 출석 : 지각 한번 0.5점 감점, 지각 두번결석 결석 5회 이상인 경우 F • 순위 : 총점으로 정렬한 뒤 그 순서대로 순위에 해당하는 변수에 차례대로 번호를 넣는다. • 학점 : 순위로 정렬한 뒤, 총 학생수를 불러온다. 총 학생수의 각각 비율대로 나누어A,B,C,D를 매긴 후 결석 횟수 5회 이상인 데이터에는 F를 매긴다.

  9. 설계 part 1

  10. 1. 메인 Main.c Struct{ intidentity_num, char name[20] etc } Void gotoxy(int x, int y); Void attend(double n, int m); Void grade(); Void add(Student *s, int n ,int m); Void modify(Student *s, int n, inta,int m); Void delete(Student*s,, int n); Voidall_student(Student*s); Void ranking(); Void array(int I, Student*s); Void show_graph(Student*s); Void addscore(Student*s); Void avgscore(Student*s)

  11. delete(intn,student *s) modify(int n, int m, int a, student *s) 2. 데이터 추가/삭제/수정 Int n;//학번 Int I;//학번으로 찾아 삭제할 학생 index Int m; M=all_student(student*s); S[i] = s[n-1]; S[n-1] =0; Int n;//총 학생수 Int m;//추가할 학생수 Int a;//바꾸고 난 점수 add(Student*s, int n, int m) All_student(Student*s) Intn;//총학생수 Int m;// 추가할 학생수 Int I; For(;;)

  12. 3. 정렬 Ranking() Array_up(int I, Student*s) Array_down(int I, Student*s) Boublearray오름 차순 Boublearray내림 차순 Array(intI,Student*s); //오름 차순 Int n; For(;;)

  13. Attend(double n, int m) 4. 점수 doube n//지각 횟수 Intm//결석 횟수 Int l//출석 점수 double o//총결석 횟수 O=m+n/2 L=10-m avgscore(Student*s) addscore(Student*s) Int I; For(;;) Int I; For(;;) Grade() Void ranking(); Void all_student(Student*s) Int a=총학생수*0.2 Int b=총학생수*0.5 //etc For(;;) if(결석>=5){f학점};

  14. 5. 출력 Show_graph(Student*s) Gotoxy(int x, int y); Printf(“”);…..etc Gotoxy(int x, int y) COORD Cur;Cur.X=x;Cur.Y=y;SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_H ANDLE),Cur);

  15. 전체 개요

  16. Addscore(student*s) delete(intn,student*s) Array_up(int I, Student*s) Array_down(int I, Student*s) Main.c modify(int n, int m, int a, student *s) All_student(Student*s) Ranking() Grade() add(Student*s) Gotoxy(int x, int y) Attend(double n, int m) Show_graph(Student*s) avgscore(Student*s)

More Related