Pearson Edexcel Level 1/Level 2 GCSE (9–1) m m m m m m
Thursday 25 May 2023 m m m
Afternoonm (Time:m 2m hours) Papermre
ference 1CP2/02
Computer Science m
mmm
PAPER 2: Application of Computational Thinking
m m m m m
Yoummustmhave:
• amcomputermworkstationmwithmappropriatemprogrammingmlanguagemcodemeditingmsoftwa
remandmtools,mincludingmanmIDEmthatmyoumaremfamiliarmwithmthatmshowsmlinemnumbers
• am‘STUDENTm CODING’mfolderm containingm codem andm datam files
• printedmandmelectronicmcopiesmofmthemProgrammingmLanguagemSubsetm(PLS)mdocume
ntm(enclosed).
Instructions
•• Answer all questions on your computer
m m
m m
m
Save the new or amended code in the ‘COMPLETED CODING’ folder using the
m m
m
m
m
m m m m m m m
name given in the question
m m m m
•• ..DoYounotmustoverwrite
m
m
the original code and data files provided to you.
m m
not use the internet at any time during the examinatio
m m m
m
m
m
m m
m
m
m
m
m m
m m
m m
Information
n.
•• Themtotalmmarkmformthismpapermism75.
Themmarksmformeachmquestionmaremshownminmbracket
–musemthismasmamguidemasmtomhowmmuchmtimemtomspendmonmeachmquestion.
• Them‘STUDENTmCODING’mfolderminmyourmusermareamincludesmallmthemcodemandmdatamfile
ssmyoumneed.
Advice
• Read each question carefully before you start to answer it.
m m m m m m m m m
• Save your work regularly
m m m
• Check your answers and work if you have time at the end.
m m m m m m m m m m m
.
Turnmover
P72596RA
©2023mPearsonmEducationmL
td.mN:1/1/1/1/1/1/1/1/1/1/
1
, BLANKmPAGE
2 P72596RA
, AnswermALLmquestions.
Suggestedmtime:m10mminutes
1 Amprogrammismbeingmdevelopedmtomshowmthemaveragemdailymtemperaturemandmaddmupmth
emcostsmofmbuyingmicemcream.
• Itmdisplaysmeachmtemperaturemstoredminmanmarraymofmtemperatures.
• Itmaddsmupmallmthemicemcreammcostsmenteredmbymthemuser,muntilmthemusermentersm0.
• Itmthenmcalculatesmamdiscount.mWhenmthemtotalmcostmismoverm100.00,mthemdiscountm
ism10%.mOtherwise,mthemdiscountmism5%.
OpenmfilemQ01.py
Amendm them linesm atm them bottomm ofm them codemtom givem the:
• namemofmamconstantmusedminmthemprogram
• namemofmanmarraymusedminmthemprogram
• linem numberm ofmanm initialisationm ofm amvariablem withm am realm number
• linem numbersm form am selectionm construct
• linem numbersm form am repetitionm construct
• linem numbersm form anm iterationm construct
• linem numberm form anm instructionm thatm outputsm informationm tom them screen.
Dom notm addm anym additionalm functionality.
SavemyourmamendedmcodemfilemasmQ01FINISHED.py
(TotalmformQuestionm1m=m7mmarks)
P72596RA 3
Turnmover
, Suggestedmtime:m15mminutes
2 Amprogrammismwrittenmformanmexercisemroutine.mItmdisplaysmthemnamesmofmwarm-
upmexercises,mstoredminmanmarray.mThemusermentersmamnumber.mThatmnumbermofmexercis
esmismselectedmrandomlymfrommthemarraymandmdisplayed.
OpenmfilemQ02.py
Amendmthemcodemto:
• fixmthemsyntaxmerrormonmoriginalmlinem4
importmrandum
• fixmthemsyntaxmerrormonmoriginalmlinem16
formexerciseminmexerciseTable
• completemoriginalmlinem20mtomgeneratemamrandommnumbermbetweenm0mandm4
indexm =m random.
• completem originalm linem 8m tom makem them exercisem namesm bem stringm datam types
exerciseTablem=m["squats",m"planks",mpushups,
"lunges",m"burpees"]
• fixmthemIndexErrorm onm originalmlinem 21
namem=m exerciseTable[indexm +m 1]
• fixm them NameErrorm onm originalm linem 22
printm(naime)
• fixmthemlogicm errorm onm originalmlinem 19m thatm causesmonem lessmexercisem tom bem printe
dmthanmismaskedmfor
form countm inm rangem (numExercisesm -m 1):
• usemwhitemspacemtom improvemthem readabilitym ofmthem code.
Dom notm changem them functionalitym ofm them givenm linesm ofm code.m
Domnotmaddmanymadditionalmfunctionality.
SavemyourmamendedmcodemfilemasmQ02FINISHED.py
(TotalmformQuestionm2m=m8mmarks)
4 P72596RA
Thursday 25 May 2023 m m m
Afternoonm (Time:m 2m hours) Papermre
ference 1CP2/02
Computer Science m
mmm
PAPER 2: Application of Computational Thinking
m m m m m
Yoummustmhave:
• amcomputermworkstationmwithmappropriatemprogrammingmlanguagemcodemeditingmsoftwa
remandmtools,mincludingmanmIDEmthatmyoumaremfamiliarmwithmthatmshowsmlinemnumbers
• am‘STUDENTm CODING’mfolderm containingm codem andm datam files
• printedmandmelectronicmcopiesmofmthemProgrammingmLanguagemSubsetm(PLS)mdocume
ntm(enclosed).
Instructions
•• Answer all questions on your computer
m m
m m
m
Save the new or amended code in the ‘COMPLETED CODING’ folder using the
m m
m
m
m
m m m m m m m
name given in the question
m m m m
•• ..DoYounotmustoverwrite
m
m
the original code and data files provided to you.
m m
not use the internet at any time during the examinatio
m m m
m
m
m
m m
m
m
m
m
m m
m m
m m
Information
n.
•• Themtotalmmarkmformthismpapermism75.
Themmarksmformeachmquestionmaremshownminmbracket
–musemthismasmamguidemasmtomhowmmuchmtimemtomspendmonmeachmquestion.
• Them‘STUDENTmCODING’mfolderminmyourmusermareamincludesmallmthemcodemandmdatamfile
ssmyoumneed.
Advice
• Read each question carefully before you start to answer it.
m m m m m m m m m
• Save your work regularly
m m m
• Check your answers and work if you have time at the end.
m m m m m m m m m m m
.
Turnmover
P72596RA
©2023mPearsonmEducationmL
td.mN:1/1/1/1/1/1/1/1/1/1/
1
, BLANKmPAGE
2 P72596RA
, AnswermALLmquestions.
Suggestedmtime:m10mminutes
1 Amprogrammismbeingmdevelopedmtomshowmthemaveragemdailymtemperaturemandmaddmupmth
emcostsmofmbuyingmicemcream.
• Itmdisplaysmeachmtemperaturemstoredminmanmarraymofmtemperatures.
• Itmaddsmupmallmthemicemcreammcostsmenteredmbymthemuser,muntilmthemusermentersm0.
• Itmthenmcalculatesmamdiscount.mWhenmthemtotalmcostmismoverm100.00,mthemdiscountm
ism10%.mOtherwise,mthemdiscountmism5%.
OpenmfilemQ01.py
Amendm them linesm atm them bottomm ofm them codemtom givem the:
• namemofmamconstantmusedminmthemprogram
• namemofmanmarraymusedminmthemprogram
• linem numberm ofmanm initialisationm ofm amvariablem withm am realm number
• linem numbersm form am selectionm construct
• linem numbersm form am repetitionm construct
• linem numbersm form anm iterationm construct
• linem numberm form anm instructionm thatm outputsm informationm tom them screen.
Dom notm addm anym additionalm functionality.
SavemyourmamendedmcodemfilemasmQ01FINISHED.py
(TotalmformQuestionm1m=m7mmarks)
P72596RA 3
Turnmover
, Suggestedmtime:m15mminutes
2 Amprogrammismwrittenmformanmexercisemroutine.mItmdisplaysmthemnamesmofmwarm-
upmexercises,mstoredminmanmarray.mThemusermentersmamnumber.mThatmnumbermofmexercis
esmismselectedmrandomlymfrommthemarraymandmdisplayed.
OpenmfilemQ02.py
Amendmthemcodemto:
• fixmthemsyntaxmerrormonmoriginalmlinem4
importmrandum
• fixmthemsyntaxmerrormonmoriginalmlinem16
formexerciseminmexerciseTable
• completemoriginalmlinem20mtomgeneratemamrandommnumbermbetweenm0mandm4
indexm =m random.
• completem originalm linem 8m tom makem them exercisem namesm bem stringm datam types
exerciseTablem=m["squats",m"planks",mpushups,
"lunges",m"burpees"]
• fixmthemIndexErrorm onm originalmlinem 21
namem=m exerciseTable[indexm +m 1]
• fixm them NameErrorm onm originalm linem 22
printm(naime)
• fixmthemlogicm errorm onm originalmlinem 19m thatm causesmonem lessmexercisem tom bem printe
dmthanmismaskedmfor
form countm inm rangem (numExercisesm -m 1):
• usemwhitemspacemtom improvemthem readabilitym ofmthem code.
Dom notm changem them functionalitym ofm them givenm linesm ofm code.m
Domnotmaddmanymadditionalmfunctionality.
SavemyourmamendedmcodemfilemasmQ02FINISHED.py
(TotalmformQuestionm2m=m8mmarks)
4 P72596RA