[C 프로그래밍] C로 배우는 프로그래밍 기초 12장 이해점검 및 프로그램문제 풀이
본 자료는 3페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
해당 자료는 3페이지 까지만 미리보기를 제공합니다.
3페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

[C 프로그래밍] C로 배우는 프로그래밍 기초 12장 이해점검 및 프로그램문제 풀이에 대한 보고서 자료입니다.

목차

■ 이해점검 풀이
■ 프로그램 문제 풀이

본문내용

15
125
28
56
34
32
69
57
56
59
45
33
45
#include
#define rows 4 // 행의 합과차를 정하는 상수
#define cols 3 // 열의 합과차를 정하는 상수
void print(int [][3]); //결과값을 출력하는 함수
int main(void)
{
int i,j;
int s1[4][3], s2[4][3];
int x[][3]={{35,28,73},
{25,32,73},
{97,56,23},
{45,97,15}};
int y[][3]={{125,28,56},
{34,32,69},
{57,56,59},
{45,33,45}};
printf("다음 두 행렬의 합과 차를 구하는 프로그램입니다.\n");
printf(" \n"
"| 35 | 28 | 73 | | 125| 28 | 56 |\n"
"| 25 | 32 | 69 | | 34 | 32 | 69 |\n"
"| 97 | 56 | 23 | | 57 | 56 | 59 |\n"
"| 45 | 97 | 15 | | 45 | 33 | 45 |\n"
" \n");
for(i=0; i for(j=0; j s1[i][j] = x[i][j] + y[i][j];
printf("\n위의 두 행렬 합의 결과 값입니다.\n");
print(s1);
for(i=0;i for(j=0;j s2[i][j] = x[i][j] y[i][j];
printf("\n위의 두 행렬 차의 결과 값입니다.\n");
print(s2);
return 0;
}
void print(int x[][3])
{
int i, j;
printf("\n");
for(i=0; i for(j=0; j printf("|%4d", x[i][j]);
printf("|\n");
}
printf("\n");
}
본인이 이번 학기에 수강하는 과목의 학점 수와 성적을 입력 받아 이번 학기의 평균평점을 출력하는 프로그램을 작성하시오. (가능한 한 많은 배열을 이용하고, 성적의 평점은 여러분 학교의 평점으로 하며, 출력 결과는 다음과 같이 하시오)
#include
void print(int totalcredit, double totalpoint);
#define NUMOFLECTURE 8
char *lecture[NUMOFLECTURE][2] = { {"교선", "21세기 트랜드와 경영"},
{"교선", "영어 듣기"},
{"교선", "현대 사회와 인간"},
{"전선", "윈도우 프로그래밍"},
{"전선", "전자상거래 응용사례"},
{"전필", "데이터베이스"},
{"전필", "시스템분석설계"},
{"전필", "웹 프로그래밍"} };
char *GRADE[] = {"F", "D0", "D+", "C0", "C+", "B0", "B+", "A0", "A+"};
double GRADEPOINT[] = {0.0, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5};
int point[NUMOFLECTURE][2];
int grade[NUMOFLECTURE];
int main(void)
{
double totalpoint = 0.0;
int totalcredit = 0;
int i=0;
printf("다음 표시되는 강좌의 학점과 점수를 입력하세요.\n");
printf("A+ : 95 ~ 100, A0 : 90 ~ 94, ");
printf("B+ : 85 ~ 89, B0 : 80 ~ 84\n");
printf("C+ : 75 ~ 79, C0 : 70 ~ 74, ");
printf("D+ : 65 ~ 69, D0 : 60 ~ 64, F : 59 이하 \n\n");
printf("입력 예 >>\n");
printf("%6s%30s", lecture[0][0], lecture[0][1]);
printf(" >> 2(학점) 96(점수)\n\n");
printf("지금부터 입력하세요. >>\n");
for (i=0; i printf("%6s%30s >> ", lecture[i][0], lecture[i][1]);
scanf("%d %d", &point[i][0], &point[i][1]);
grade[i] = point[i][1] / 5;
totalpoint += point[i][0] * GRADEPOINT[grade[i]11];
totalcredit += point[i][0];
//printf("%lf\n", GRADEPOINT[grade[i]11]);
}
print(totalcredit, totalpoint);
return 0;
}
void print(int totalcredit, double totalpoint)
{
int i;
printf("\n**************************************************************\n");
printf("%7s%18s%17s%18s\n", "구분","과 목 명","학 점","성 적");
printf("\n");
for (i=0; i printf("%7s%23s%12d%16s\n", lecture[i][0], lecture[i][1],
point[i][0], GRADE[grade[i]11]);
printf("\n");
}
printf("%7s%18s%17s%18s\n","학점계","평 점 계","평점평균","백분율환산");
printf("**************************************************************\n");
printf("%7d%17.1f%14.2f/4.5%17.1f\n", totalcredit, totalpoint,
(totalpoint / totalcredit), 100 * (totalpoint / totalcredit) / 4.5 );
printf("**************************************************************\n");
}
  • 가격2,000
  • 페이지수11페이지
  • 등록일2008.08.03
  • 저작시기2008.7
  • 파일형식한글(hwp)
  • 자료번호#475262
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니