MOT so BANG Bill TAP HIEN HINH TROHG GIJlHG HAY HAI TAP M6N TIN HOC 11 I Viec dgy bdi tdp (BT) tin hpc Id mdt hinh thuc hogt ddng cOo tin hpc, dgc biet Id phdn BT lap trinh cOo Tin hpc 11 Hinh thuc nd[.]
MOT so BANG Bill TAP HIEN HINH TROHG GIJlHG HAY HAI TAP M6N TIN HOC 11 O iec dgy bdi tdp (BT) tin hpc Id mdt hinh thuc hogt ddng cOo tin hpc, dgc biet Id phdn BT lap trinh cOo Tin hpc 11 Hinh thuc ndy t h i hl§n qua viee day BT li thuylt vd viec dgy BT thyc hdnh tren mdy Khi gidng dgy BT, gido vien (GV) khdng cung nnde vdi cdch dgy BT mang tinh truyin fhdng Id ke bdng chia thdnh nhilu phdn, sou dd igl HS len vllt chuong trinh hodc trd ldi cdc cdu ldi sdch gido khoa (SGK), GV ddnh gid vd kit thuc Viec Idm ndy gdn viec dgy BT vdi chuc ndng cung ed vd kilm tra nhilu hon Bdi viit trinh bdy mdt so dgng BT md GV cd t h i tham khdo d l cd the thay dd'i, cdi hin qud trinh gidng dgy Dd'i vdi dgng BT cung cd li thuyet Trong chuong trinh phd thdng, logi hinh BT ndy thudng xud't hidn dudi dgng nhirng cdu hdi d cudi bdi, cudi chuong nhu: - Tgi soo ngudi to phdi xdy dyng cdc ngdn ngu ldp trinh bdc cao (Bdi - phdn cdu hdi vd BT 1, Tin hgc 11); - Hdy cho biet sy gidng vd khde cuo dgng cdu lenh if-then (Bdi - phdn cdu hdi vd BT 9, 10 Tin hgc 11);- Cdc phdn tu cua mdng cd f h l Id nhirng kilu du lidu gi (Bdi phdn edu h d i v d B T l l , 12, 13 Tin hgc 11) Vdi nhung logi cdu hdi BT ndy, GV thudng ddt ro phdn kilm tro bdi eu hodc phdn cung CO HS cd t h i frd ldi dOng ede edu hdi ndy bdng cdch hpc thudc Idng hodc nhin vdo sdch d l trd ldi Chung tdi gpi y thay dd'i hinh thuc cdc edu hdi nhdm tgo thO, ddng thdi cd t h i td chuc HS hgc tdp, thdo Tudn theo nhdm nhd, Vi du i: Cd the dua cdu sou: Chuong trinh dupe v l l t bdng ngdn ngu bdc eao khdng cd dgc diem ndo cdc dgc diem sou ddy: a) Ngdn ggn, de hieu, de hieu chinh; b) Khdng phy thudc vdo logi mdy tinh; c) Mdy tinh ed t n l hieu vd thyc hien trye tiep chuang frinh ndy; d) Td chuc du lieu dgng thudn tien viec md fd thudt todn; e) Gdn gui vdi ngdn ngO tu nhien thudn tien cho ddng ddo ngudi lap tnnh Vidu Bgn Nam thdc mde rdng: «Trong edu V I Le VIET CHUNG* lenh re nhdnh, cdu lenh vd cdu lenh sou tu khdo then vd else ed t h i Id mdt edu lenh re nhdnh dupe khdng? Neu vdy thi trinh bdy cdu lenh nhu the ndo cho d i hieu, de dpc vd de kiem tro" Cdc em hdy gidi thich gium ban Nam BT lien quan den kT ndng lap frinh 1) BTvidf chuang trinh:Day\a dgng BT thdng thudng dien hinh vd chilm phdn Idn ndi dung BT SGK vd thdi gian tren Idp HS phd thdng hien rdt nggi nhi/ng BT ndy Thyc chdt vdn de Id GV khdng gidi thich y nghTo cOa bdi todn cOng nhu md'i lien he input vd output ciia bdi todn d l HS thdy rdng cdc em ed dO khd ndng hiiu vd gidi quyet nd Hon nua logi BT ndy gidi fren bdng thi thudng it cd dieu kidn d l kilm chung cOng nhu Id ddnh gid tinh dung eua ehuong trinh Vdi logi BT ndy GV thudng cho HS gidi tren gid'y hodc trinh bdy tren bdng den, dd edn nhdn thuc rdng viee kiem chung tren mdy Id hinh thuc thao tdc, KTndng don gidn, viee gidi BT tren gidy, tren bdng mdi thyc sy ed tdc dyng quan trgng viee ren luyen ede thao tdc tu Trong hinh thuc ndy GV ludn hudng ddn HS cdch xde ldp ddu vdo, ddu ra, hudng xu li (input, output vd processing), Kep theo Id djnh hinh xde djnh kilu du lieu vdo vd sy rdng budc giira cdc dir kien de tim ro thudt todn Vi du 1: Hdy viet ehuong trinh nhdp so o (a > 0) rdi tinh vd dua dien tieh phdn dugc ggeh cheo frong hinh sou (kit qud Idm trdn den chir sd thdp phdn) (Bdi - Tin hgc 11) Hudng don eua GV: Input: a: Real; Output: S (phdn ggeh cheo): Real; N l u Idm phep quay 180° qua hxic dd'i xung to cd the thdy: Dien tich phdn ggeh cheo bdng / diSn tieh hinh frdn tdm O(0,-0), bdn * TrMig (ai hpc s« pha* - BH Sa Naii{ Tap ehi Glao due so 0 (ki a - la/aoiai kinh R = a Luu y: Sd p Id mdt hdng frong pascal vddupe ki hiduld Pi ed gid frj 3,141592 Wc/v2:Nhdph/bdn phim tudi eOa cho vd (hien tgi Kidi cho Idn hon hoi Idn tudi eon vd tudi cha hon tud'i eon it nhd't Id 25) Duo ro mdn hinh cdu trd ldi cho cdu hdi «Bao nhieu ndm nira thi Kjd'i cho gdp ddi Kidi eon?" Hudng dan: Input: tud'i cho, fudi eon < kie du lieu nguyen> Output: Cdu trd ldi «Bao nhieu ndm nua thi Kidi cha gdp ddi Kidi eon" Md'i lien he giua tudi cha vd Kjoi eon hien Id gi? Tudi cha Idn hon hai Idn tud'i eon: tuoi cho > 2*tuoi Tud'i cho hon tudi eon it nhd't Id 25: tuoi cho > 91 92 93 94 95 96 97 98 99 100 Gid su sou GV hudng ddn vd HS dd cd ldi gidi nhu sou: Fori;=0to9do Begin For j:=l to 10dowrite(10'i-i-j:4); Writein; End; Budc^ 1: Gid su GV tim each thay dd'i biln j frong bilu thuc V^rite( 10* j+i :4) thu xem HS dodn dugc se in bdng gi? Bdng mdt edeh ndo dd Thdy gido hudng dan dupe HS nhdn ro bdng kit qud Id: 10 20 30 40 50 60 70 80 90 100 11 21 31 41 51 61 71 81 91 101 19 29 39 49 59 69 79 89 99 109 Budc 2: GV mdt Idn nira Kr cho HS viet Igi ehuong trinh cho bdng dupe thay ddi theo chilu = KJOI eon +25 dpc nhu sou: Do dd, nhdp du lieu cho fudi cho vd Kidi 11 21 91 eon, cdn phdi thda mdn d i l u kifn tren Dd Id 12 22 92 mdu chd't cOa bdi todn 313 Chu y: 1) Trong dgng BT ndy cdn hudng ddn 414 cho HS edeh trinh bdy mdt chuong trinh tren gid'y, 515 fren bdng eOng nhu trdn mdy dd Id cdch frinh 616 bdy cd cdu true cdc ISnh khdi thyt vdo, cOng 717 khdi ngang nhau, chuong trinh chinh (begin vd 818 end phdi chu hoa), cdc thu Kic, hdm phdi fdch 919 blit cd ki hieu phdn edeh rd rdng d l chuong frinh 10 20 30 40 50 60 70 80 90 100 nd'l bdt dupe tinh cd'u true, rd rdng giOp ngudi Khi HS gidi dupe bdi todn ndy thi thdt sy HS ldp frinh cung nhu ngudi hudng ddn de dpc, dd dd ndm rdt kT v l cdu lenh for vd kT ndng ldp frinh tim vd phdt hi§n loi; 2) Dieu chinh ede cdch trinh 3) Dgng BT dgc ehuong trinh vd phdt hien bdy dir lieu mdn hinh d l ehgy tren mdy cd ki't qud sau thuc hien Ddy Id dgng BT dt/gc kit qud rd rdng, hgp li nhu: + Trinh bdy thO khd, thdng thudng ehi ed HS khd, gidi mdi ed f h l h^c nhdp du lieu bdng cdp: write ('thdng bdo:'); thyc hien dugc vi nd yeu edu phdi ndm rd vd reodln (biln); + Trinh bdy thO hjc xud't dir lieu hiiu kT bdn chd't cdc hdm, cdc lenh cung nhu hiiu theo khudn dgng writein ( x:m:n); rd thudt todn cua bdi todn, dd gidi cdc BT 2) Dgng BT dgc chuong trinh Day Id logi ndy GV cdn phdi dn tdp ede edu lenh, ede hdm, BT dgc chuong trinh frong hinh thuc dgy gidi BT ede phep todn ed lien quan d i n frong BT Chuang trinh sou in kit qud gi fren mdn fin hpc, giup HS ren luy§n ndng lye fhav ddi nhanh chdng vd a l ddng hudng suy nghT, ijgng tu hinh to nhdp xdu ht='Ton ngo khong' ? ihugn chuyin qua K/ nghjeh (ddy cung Id mdt Program vidu; dgng nhu tinh ddo ngupc eua qud frinh K/ Varht,t;string[30]; i,n: byte; suy ludn todn hgc) Ren luyen dupe ndng lye Begin quan sdt, phdn tich Km cho sal, thSm vdo, bdt ra, Write('nhap ho ten:');readln(ht); phdt hien d i l u chinh, v.v Vi dy: Dgc vd viet tir n:=length(ht); i:=n; Iclf qud sang ehuong frinh vd ngupc Igi: whilehl(i]' 'doi:=i-l; Vilf chuong trinh in bdng sou: t:=copy(ht,l+l,n-i); wrile(t); 12345678910 End 11 12 131415161718 1920 Tap ehi Glao due s6 0 (ki a • la/aoia) 4) Dgng BTtim ldi chuong trinh Dgng BT ndy cd t n l cho HS Idm theo nhdm rdm ri (nhdm ldm thdi) hogt ddng Kr 5-7 phut Dgng ndy giOp ren luyen HS khd ndng quan sdt ehuong trinh, phdn tich ehuong frinh, dd dgy GV edn ehu y d i n ldi thudng xdy ro Id: loi cO phdp vd ldi thudt todn Thdng thudng, loi cu phdp HS d l phdt hien edn loi thudt todn GV hudng ddn HS each ehgy chdm vd each trinh bdy kit qud de phdt hien loi Vi dy 1: HS A viet dogn chuong trinh sou de kiem tro mdt mdng so nguyen dupe nhdp cd phdi Id mdng tdng hay khdng? (Mdng A dugc ggi Id mdng tdng neu to ed a [i]