C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[4564] 꼭 좀 요!
바부~ [] 3203 읽음    2000-12-09 00:00
안녕하세요???

수고가 많으십니다~~

헤헷*^^*

다름이 아니궁..

저는 중3 여학생인데요

어떤 계기로 해서...

c++언어를 접하게 되었어요~

구런데..

그게...

첨 부터 배운것두 아니구...

해서~

어려운 점이 만거든요~~

아시는 분 좀 ..

꼭 멜이나...

이 글 밑에 답 좀 달아주세요~~~

꼭 좀 부탁드립니다~~~~~~~~~~

도와주세요!!!!!!!!!!!!!!

=================================================================================

[문제1] 다음의 성적 프로그램을 클래스 배열을 이용하여 작성하였다.
      (       ) 안에 알맞은 내용을 쓰시오.
=============================================
학  번   이  름   국어   영어   수학   총점   평균
=============================================
30101    김소라    99     88     77    264   88.00
30102    아름이    78     98     87    263   87.67
30103    박희정    89    100     83    272   90.67
30104    정다워    97     92     80    269   89.67
30105    이정진    91     90     81    262   87.33
============================================

#include
#include
#include
const int SU=5;
const int KW=3;
class sungjuk{
private:
int hakbun;
char *irum;
int jumsu[KW], tot;
public:
void prin1(class sungjuk *);
void prin2(void);
};

inline void sungjuk::prin1(class sungjuk sung[]){
cout<<"\n=============================================\n";
cout<<"학 번  이 름  국어 영어  수학  총점  평균\n";
cout<<"\=============================================\n";
for(int a=0; a
(       ?             )
cout<<"============================================ \n";
}

inline void sungjuk::prin2(void){
cout< };

void main(void){
clrscr();
class sungjuk sung[]={
       {30101,"김소라", 99, 88, 77 },
       {30102,"아름이", 78, 98, 87 },
       {30103,"박희정", 89, 100, 83 },
       {30104,"정다워", 97, 92, 80 },
       {30105,"이정진", 91, 90, 81 }
       };
class sungjuk su;
su.prin1(sung);
getch();
}

[문제2] 위의 성적 프로그램을 클래스 포인터를 이용하여 작성하였다.
(         )  안에 알맞은 내용을 쓰시오.

#include
#include
#include
const int SU=5;
const int KW=3;
class sungjuk{
private:
int hakbun;
char *irum;
int jumsu[KW], tot;
public:
void prin1(class sungjuk *);
void prin2(void);
};

inline void sungjuk::prin1(class sungjuk *sung){
cout<<"\n=============================================\n";
cout<<"학 번  이 름  국어 영어  수학  총점  평균\n";
cout<<"\=============================================\n";
for(int a=0; a
(         ?             )
cout<<"============================================ \n";
}

inline void sungjuk::prin2(void){
cout< };

void main(void){
clrscr();
class sungjuk sung[]={
       {30101,"김소라", 99, 88, 77 },
       {30102,"아름이", 78, 98, 87 },
       {30103,"박희정", 89, 100, 83 },
       {30104,"정다워", 97, 92, 80 },
       {30105,"이정진", 91, 90, 81 }
       };
class sungjuk *su;
su->prin1(sung);
getch();
}


[문제3] 프렌드 함수를 이용하여 전용데이터에 접근하는 프로그램을 작성하였다.
(        ) 안에 알맞은 내용을 쓰시오.

#include
#include
#include
#include
class sawon{
private:
  char irum[14];
  char jumin[15];
  int age;
public:
void init(char *, char *, int);
friend void print(class sawon p1);
};
void sawon::init(char *ir, char *ju, int ag){
strcpy(irum, ir);
strcpy(jumin, ju);
age=ag;
}

void main(void){
clrscr();
sawon sa1, sa2;
sa1.init("정다워","750929-1401110",17);
sa2.init("한소라","751212-2402222",16);
print(sa1);
print(sa2);
getch();
}

void print(class sawon p1){
cout<<"이름: "<< (  ?    ) <<"\n";
cout<<"주민등록번호:"<< ( ?      )<<"\n";
cout<<"나이: "<< (    ?  ) <<"\n";
}

+ -

관련 글 리스트
4564 꼭 좀 요! 바부~ 3203 2000/12/09
4566     Re:꼭 좀 요! 못난이 3500 2000/12/09
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.