비베 6.0을하는데 석차쪽질문좀 드릴게요 ㅠ
딸기맛사탕
질문 제목 : 비베 6.0 석차구하기10명의 데이터를 배열로 받아 추가하여서 나중에 석차구하기 버튼을 누르면 1~10위순으로 누를때마다 1,2,3,4...10등이 뜨는 프로그램을만드는데요 잘안되네요 ...질문 내용 : 일단 제가짠소스는 아래와같은데요
dim i, k, j, h, temp as integer
dim korscore(10), engscore(10), mathscore(10), vibascore(10), total(10) as integer
dim korcredit(10), engcredit(10), mathcredit(10), vibacredit(10), appcredit(10), getcredit(10) as integer
dim aver(10), average(10) as double
dim hak(10) as double
dim kavaverage(10), mavaverage(10), eavaverage(10), vavaverage(10), avaverage(10), ava(10) as double
dim naming(10) as string
private sub label8_click()end subprivate sub cmdadd_click()
txthak.text =
txtname.text =
txtkorscore.text =
txtengscore.text =
txtmathscore.text =
txtvibascore.text =
txtkorcredit.text =
txtengcredit.text =
txtmathcredit.text =
txtvibacredit.text =
txtkorgrade.text =
txtenggrade.text =
txtmathgrade.text =
txtvibagrade.text =
txttotal.text =
txtaverage.text =
txtavaverage.text =
txtappcredit.text =
txtgetcredit.text =
i = i + 1
if i = 10 then
msgbox 10명을 초과하였습니다
end if
end subprivate sub cmderase_click()
txtkorscore.enabled = false
txtengscore.enabled = false
txtmathscore.enabled = false
txtvibascore.enabled = false
txtkorcredit.enabled = false
txtengcredit.enabled = false
txtmathcredit.enabled = false
txtvibacredit.enabled = false
txtkorgrade.enabled = false
txtenggrade.enabled = false
txtmathgrade.enabled = false
txtvibagrade.enabled = false
txttotal.enabled = false
txtaverage.enabled = false
txtavaverage.enabled = false
txtappcredit.enabled = false
txtgetcredit.enabled = false
end subprivate sub cmdexit_click()
end
end subprivate sub cmdrank_click()
for i = 0 to 9
for k = i to 9
if avaverage(k) avaverage(k + 1) then
temp = avaverage(k)
avaverage(k) = avaverage(k + 1)
avaverage(k + 1) = temp
end if
next k
next i
txtname.text = naming(j)
txthak.text = hak(j)
txtkorscore.text = korscore(j)
txtengscore.text = engscore(j)
txtmathscore.text = mathscore(j)
txtvibascore.text = vibascore(j)
txtkorcredit.text = korcredit(j)
txtengcredit.text = engcredit(j)
txtmathcredit.text = mathcredit(j)
txtvibacredit.text = vibacredit(j)
txtkorgrade.text = korgrade(j)
txtenggrade.text = enggrade(j)
txtmathgrade.text = mathgrade(j)
txtvbgrade.text = vibagrade(j)
txttotal.text = total(j)
txtaverage.text = average(j)
txtappcredit.text = appcredit(j)
txtavaverage.text = avaverage(j)
txtgetcredit.text = getcredit(j)
if korscore(h) = 95 then
txtkorgrade.text = a+
elseif korscore(h) = 90 then
txtkorgrade.text = a0
elseif korscore(h) = 85 then
txtkorgrade.text = b+
elseif korscore(h) = 80 then
txtkorgrade.text = b0
&nb
elseif korscore(h) = 75 then
txtkorgrade.text = c+
elseif korscore(h) = 70 then
txtkorgrade.text = c0
elseif korscore(h) = 65 then
txtkorgrade.text = d+
elseif korscore(h) = 60 then
txtkorgrade.text = d0
else
txtkorgrade.text = f
end if
if engscore(h) = 95 then
txtenggrade.text = a+
elseif engscore(h) = 90 then
txtenggrade.text = a0
elseif engscore(h) = 85 then
txtenggrade.text = b+
elseif engscore(h) = 80 then
txtenggrade.text = b0
elseif engscore(h) = 75 then
txtenggrade.text = c+
elseif engscore(h) = 70 then
txtenggrade.text = c0
elseif engscore(h) = 65 then
txtenggrade.text = d+
elseif engscore(h) = 60 then
txtenggrade.text = d0
else
txtenggrade.text = f
end if
if mathscore(h) = 95 then
txtmathgrade.text = a+
elseif mathscore(h) = 90 then
txtmathgrade.text = a0
elseif mathscore(h) = 85 then
txtmathgrade.text = b+
elseif mathscore(h) = 80 then
txtmathgrade.text = b0
elseif mathscore(h) = 75 then
txtmathgrade.text = c+
elseif mathscore(h) = 70 then
txtmathgrade.text = c0
elseif mathscore(h) = 65 then
txtmathgrade.text = d+
elseif mathscore(h) = 60 then
txtmathgrade.text = d0
else
txtmathgrade.text = f
end subprivate sub cmdstart_click()
naming(i) = txtname.text
hak(i) = val(txthak.text)
korscore(i) = val(txtkorscore.text)
engscore(i) = val(txtengscore.text)
mathscore(i) = val(txtmathscore.text)
vibascore(i) = val(txtvibascore.text)
korcredit(i) = val(txtkorcredit.text)
engcredit(i) = val(txtengcredit.text)
mathcredit(i) = val(txtmathcredit.text)
vibacredit(i) = val(txtvibacredit.text)
total(i) = korscore(i) + engscore(i) + mathscore(i) + vibascore(i)
aver(i) = total(i) / 4
average(i) = round(aver(i), 2)
appcredit(i) = korcredit(i) + engcredit(i) + mathcredit(i) + vibacredit(i)
txttotal.text = str(total(i))
txtaverage.text = str(average(i))
txtappcredit.text = str(appcredit(i))
if korscore(i) = 95 then
txtkorgrade.text = a+
elseif korscore(i) = 90 then
txtkorgrade.text = a0
elseif korscore(i) = 85 then
txtkorgrade.text = b+
elseif korscore(i) = 80 then
txtkorgrade.text = b0
elseif korscore(i) = 75 then
txtkorgrade.text = c+
elseif korscore(i) = 70 then
txtkorgrade.text = c0
elseif korscore(i) = 65 then
txtkorgrade.text = d+
elseif korscore(i) = 60 then
txtkorgrade.text = d0
else
txtkorgrade.text = f
end if
if engscore(i) = 95 then
txtenggrade.text = a+
elseif engscore(i) = 90 then
txtenggrade.text = a0
elseif engscore(i) = 85 then
txtenggrade.text = b+
elseif engscore(i) = 80 then
txtkorgrade.text = b0
elseif engscore(i) = 75 then
txtenggrade.text = c+
elseif engscore(i) = 70 then
txtenggrade.text = c0
elseif engscore(i) = 65 then
txtenggrade.text = d+
elseif engscore(i) = 60 then
txtenggrade.text = d0
else
txtenggrade.text = f
end if
if mathscore(i) = 95 then
txtmathgrade.text = a+
elseif mathscore(i) = 90 then
txtmathgrade.text = a0
elseif mathscore(i) = 85 then
txtmathgrade.text = b+
&;
elseif mathscore(i) = 80 then
txtmathgrade.text = b0
elseif mathscore(i) = 75 then
txtmathgrade.text = c+
elseif mathscore(i) = 70 then
txtmathgrade.text = c0
elseif mathscore(i) = 65 then
txtmathgrade.text = d+
elseif mathscore(i) = 60 then
txtmathgrade.text = d0
else
txtmathgrade.text = f
end if
if vibascore(i) = 95 then
txtvibagrade.text = a+
elseif vibascore(i) = 90 then
txtvibagrade.text = a0
elseif vibascore(i) = 85 then
txtvibagrade.text = b+
elseif vibascore(i) = 80 then
txtvibagrade.text = b0
elseif vibascore(i) = 75 then
txtvibagrade.text = c+
elseif vibascore(i) = 70 then
txtvibagrade.text = c0
elseif vibascore(i) = 65 then
txtvibagrade.text = d+
elseif vibascore(i) = 60 then
txtvibagrade.text = d0
else
txtvibagrade.text = f
end if
if korscore(i) 70 then
korcredit(i) = 0
end if
if engscore(i) 70 then
engcredit(i) = 0
end if
if mathscore(i) 70 then
mathcredit(i) = 0
end if
if vibascore(i) 70 then
vibacredit(i) = 0
end if
getcredit(i) = korcredit(i) + engcredit(i) + mathcredit(i) + vibacredit(i)
txtgetcredit.text = str(getcredit(i))
ava(i) = ((korscore(i) * korcredit(i)) + (engscore(i) * engcredit(i)) + (mathscore(i) + mathcredit(i)) + (vibascore(i) * vibacredit(i))) / 5
avaverage(i) = round(ava(i), 2)
txtavaverage.text = str(avaverage(i))
end subprivate sub text1_change()end subprivate sub text10_change()end subprivate sub form_activate()
txtname.setfocus
end subprivate sub txtappcredit_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtgetcredit.setfocus
end if
end subprivate sub txtavaverage_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtappcredit.setfocus
end if
end subprivate sub txtaverage_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtavaverage.setfocus
end if
end subprivate sub txtengcredit_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtmathscore.setfocus
end if
end subprivate sub txtengscore_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtengcredit.setfocus
end if
end sub
private sub txtgetcredit_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtrank.setfocus
end if
end sub
private sub txthak_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtkorscore.setfocus
end if
end sub
private sub txtkorcredit_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtengscore.setfocus
end if
end sub
private sub txtkorscore_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtkorcredit.setfocus
end if
end sub
private sub txtmathcredit_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtvibascore.setfocus
end if
end sub
private sub txtmathscore_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtmathcredit.setfocus
end if
end sub
private sub txtname_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txthak.setfocus
end if
end sub
private sub txtrank_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtname.setfocus
end if
end sub
private sub txttotal_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtaverage.setfocus
end if
end sub
private sub txtvibascore_keypress(keyascii as integer)
if keyascii = vbkeyreturn then
txtvibacredit.setfocus
 sp; end if
end sub
너무길어서 ..봐주실분이 혹시나 있어서 올려봅니다 ㅠㅠ 잘못된것 지적후 수정해주시면 감사하겠습니다
교수님이 배열,석차를 알려주시질 않고 내주셔서 독학으로 짜긴짰는데 한계네요 ㅠㅠ
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2676182 | 숫자 순서대로 배열하는법 | 권뉴 | 2024-11-24 |
2676152 | 기본적인거 하나 질문드립니다. | 개미 | 2024-11-24 |
2676124 | 함수선언관련 질문이에요~...털썩..수정완료 (2) | 가지 | 2024-11-24 |
2676092 | C언어 책 (2) | 아서 | 2024-11-24 |
2676065 | 웹사이트 또는 메신저 등에서 원하는 텍스트를 검사하는방법?? (1) | 모든 | 2024-11-23 |
2676033 | 배열 기초연습중 발생하는 에러 ㅠㅜ... | Creative | 2024-11-23 |
2676005 | keybd_event 게임 제어 | 영글 | 2024-11-23 |
2675900 | 진짜기본적인질문 | 글길 | 2024-11-22 |
2675845 | 수정좀해주세요ㅠㅠㅠ | 해골 | 2024-11-21 |
2675797 | 병합 정렬 소스 코드 질문입니다. (2) | 도래솔 | 2024-11-21 |
2675771 | 큐의 활용이 정확히 어떻게 되죠?? | 해긴 | 2024-11-21 |
2675745 | 도서관리 프로그램 질문이요 | 도리도리 | 2024-11-20 |
2675717 | 2진수로 변환하는것! (3) | 동생몬 | 2024-11-20 |
2675599 | for문 짝수 출력하는 법 (5) | 널위해 | 2024-11-19 |
2675575 | Linux 게시판이 없어서.. | 첫삥 | 2024-11-19 |
2675545 | 구조체 이용할 때 함수에 자료 넘겨주는 것은 어떻게 해야 하나요? | 아연 | 2024-11-19 |
2675518 | 사각형 가로로 어떻게 반복해서 만드는지좀.. 내용 | 신당 | 2024-11-18 |
2675491 | !느낌표를 입력하는것은 어떻게합니까~~?ㅠㅠ (5) | 사지타리우스 | 2024-11-18 |
2675411 | 파일입출력으로 받아온 파일의 중복문자열을 제거한 뒤 파일출력 | 앨버트 | 2024-11-17 |
2675385 | 링크드리스트 주소록 질문드립니다. (1) | 겨루 | 2024-11-17 |