[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-208288-en":3,"doc-seo-208288-105":30,"detail-sidebar-cat-0-en-105":90},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},208288,962084925782,"Chloe Bennett","https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc",4,"Exam","20 CODE CHALLENGES - Programming and coding exercises","A set of twenty GCSE (9–1) Computer Science code challenge ideas covering typical beginner to intermediate programming tasks. Each challenge describes the main program goal plus optional extensions, ranging from games and string/word utilities to input validation and data handling. Topics include Mastermind, averages, an email validator, password reset logic, list manipulation, max/min tracking, letter search, palindrome checking, counting words and vowels, a unit converter, and other practical utilities suitable for classroom teaching and assessment preparation.","20 CODE CHALLENGES  \nFebruary 2015  \nGCSE (9–1)  \nComputer Science  \nWe will inform centres about any changes to the specification. We will also publish changes on our website. The latest version of our specification will always be the one on our website ([www.ocr.org.uk](www.ocr.org.uk)) and this may differ from printed versions.  \nCopyright © 2015 OCR. All rights reserved.  \nCopyright  \nOCR retains the copyright on all its publications, including the specifications. However, registered centres for OCR are permitted to copy material from this specification booklet for their own internal use.  \nOxford Cambridge and RSA Examinations is a Company Limited by Guarantee. Registered in England. Registered company number 3484466.  \nRegistered office: 1 Hills Road  \nCambridge  \nCB1 2EU  \nOCR is an exempt charity.  \nThis resource is an exemplar of the types of materials that will be provided to assist in the teaching of the new qualifications being developed for first teaching in 2016. It can be used to teach existing qualifications but may be updated in the future to reflect changes in the new qualifications. Please check the OCR website for updates and additional resources being released. We would welcome your feedback so please get in touch.  \nGCSE (9–1) COMPUTER SCIENCE 20 CODE CHALLENGES  \nCONTENTS  \nMASTERMIND 4  \nAVERAGES 4  \nEMAIL VALIDATOR 4  \nPASSWORD RESET PROGRAM 5  \nBASIC LISTS 5  \nMAX AND MIN LIST 6  \nLETTER LIST 6  \nRPG CHARACTER/POKEMON STAT CREATOR 6  \nQUIZ MAKER 6  \nCHECK IF PALINDROME 6  \nCOUNT WORDS IN A STRING 7  \nPIG LATIN 7  \nCOUNT VOWELS 7  \nUNIT CONVERTER (TEMP, CURRENCY, VOLUME, MASS AND MORE) 7  \nCHANGE RETURN PROGRAM 7  \nSHOPPING LIST 8  \nHANGMAN 8  \nSQUARES 8  \nTIMES TABLES 9  \nBINARY/HEXIDECIMAL/DECIMAL 9  \n3  \nGCSE (9–1) COMPUTER SCIENCE 20 CODE CHALLENGES  \n\n| 1 | Mastermind\u003Cbr>Generate a random four digit number. The player has to keep inputting four digit numbers until they guess the randomly generated number. After each unsuccessful try it should say how many numbers they got correct, but not which position they got right. At the end of the game should congratulate the user and say how many tries it took.\u003Cbr>Extensions:\u003Cbr>1. Let the user pick an easy mode which shows the user which position that they guessed correctly\u003Cbr>2. Let the user pick a hard mode that gives five digits instead of four\u003Cbr>3. After the game is finished, ask the user for their name and input their score into a table. Show them the high score at the start of the game so that it gives a sense of competition. |\n| --- | --- |\n| 2 | Averages\u003Cbr>Make a program that asks the user for a series of numbers until they either want to output the average or quit the program.\u003Cbr>Extensions:\u003Cbr>1. Expand the program to print the median and mode averages also\u003Cbr>2. Include options so that if the user wants to, they can save their list of numbers to a text file and read them back out later on. |\n| 3 | Email validator\u003Cbr>Make a program to check whether an email address is valid or not.\u003Cbr>For instance, you could make sure that there are no spaces, that there is an @ symbol and a dot somewhere after it. Also check the length of the parts at the start, and that the end parts ofthe address are not blank.\u003Cbr>Extensions:\u003Cbr>1. When an email address is found to be invalid, tell the user exactly what they did wrong with their email address rather than just saying it is invalid\u003Cbr>2. Allow the user to choose to give a text file with a list of email addresses and have it process them all automatically. |\n\n4  \nGCSE (9–1) COMPUTER SCIENCE 20 CODE CHALLENGES  \n\n| 4 | Password reset program\u003Cbr>Only accept a new password if it is:\u003Cbr>1. At least eight characters long\u003Cbr>2. Has lower case and upper case letters.\u003Cbr>The password reset program should also make the user input their new password twice so that the computer knows that the user has not made any mistakes when typing their new password.\u003Cbr>Extensions:\u003Cbr>1. Make some sort of algorithm to suggest how stron","cbCaihXL9JKpKCf2","https://ap.wps.com/l/cbCaihXL9JKpKCf2","pdf",1991918,1,11,"English","en",105,"# Contents\n## Mastermind\n## Averages\n## Email validator\n## Password reset program\n## Basic lists\n## Max and min list\n## Letter list\n## RPG character/Pokemon stat creator\n## Quiz maker\n## Check if palindrome\n## Count words in a string\n## Pig Latin\n## Count vowels\n## Unit converter (temp, currency, volume, mass and more)\n## Change return program\n## Shopping list\n## Hangman\n## Squares\n## Times tables\n## Binary/hexadecimal/decimal","[{\"question\":\"What does the document provide for GCSE Computer Science teaching?\",\"answer\":\"It provides a set of twenty code challenge prompts with clear program goals and extension options to support teaching and practice for GCSE (9–1) Computer Science.\"},{\"question\":\"What kinds of programming tasks are included?\",\"answer\":\"The challenges cover games like Mastermind, numeric processing like averages and max/min, validation tasks like email validation and password reset rules, and utilities for strings, lists, and conversions.\"},{\"question\":\"How are extensions used within each challenge?\",\"answer\":\"Each challenge lists optional extensions that add extra functionality, such as difficulty modes, additional calculated statistics, file save/load features, stronger password checks, or improved output behavior.\"}]","20 CODE CHALLENGES - Programming and coding exercises | PDF",1788603369,28,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":85,"head_meta":87,"extra_data":89,"updated_unix":28},"20-code-challenges-programming-and-coding-exercises","",{"@graph":36,"@context":84},[37,53,67],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/exam/",3,{"item":52,"name":13,"@type":43,"position":11},"https://docshare.wps.com/document/20-code-challenges-programming-and-coding-exercises/208288/",{"url":52,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":61,"encodingFormat":60,"isAccessibleForFree":62,"interactionStatistic":63},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-09-05",true,{"@type":64,"interactionType":65,"userInteractionCount":4},"InteractionCounter",{"@type":66},"ViewAction",{"@type":68,"mainEntity":69},"FAQPage",[70,76,80],{"name":71,"@type":72,"acceptedAnswer":73},"What does the document provide for GCSE Computer Science teaching?","Question",{"text":74,"@type":75},"It provides a set of twenty code challenge prompts with clear program goals and extension options to support teaching and practice for GCSE (9–1) Computer Science.","Answer",{"name":77,"@type":72,"acceptedAnswer":78},"What kinds of programming tasks are included?",{"text":79,"@type":75},"The challenges cover games like Mastermind, numeric processing like averages and max/min, validation tasks like email validation and password reset rules, and utilities for strings, lists, and conversions.",{"name":81,"@type":72,"acceptedAnswer":82},"How are extensions used within each challenge?",{"text":83,"@type":75},"Each challenge lists optional extensions that add extra functionality, such as difficulty modes, additional calculated statistics, file save/load features, stronger password checks, or improved output behavior.","https://schema.org",{"og:url":52,"og:type":86,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":88,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":91},[92,96,100,103,108,113,118,123,128,131,135],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":93,"show_sort_weight":94,"slug":95},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":97,"show_sort_weight":98,"slug":99},"Literature",80,"literature",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":101,"slug":102},70,"exam",{"id":104,"doc_module":4,"doc_module_name":46,"category_name":105,"show_sort_weight":106,"slug":107},5,"Comic",60,"comic",{"id":109,"doc_module":4,"doc_module_name":46,"category_name":110,"show_sort_weight":111,"slug":112},6,"Technology",50,"technology",{"id":114,"doc_module":4,"doc_module_name":46,"category_name":115,"show_sort_weight":116,"slug":117},7,"Healthcare",40,"healthcare",{"id":119,"doc_module":4,"doc_module_name":46,"category_name":120,"show_sort_weight":121,"slug":122},8,"Research & Report",30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":104,"slug":138},19,"General","general"]