[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-314871-105":59,"doc-detail-314871-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","ap-computer-science-a-section-ii-free-response-questions-2023","AP® Computer Science A - Section II Free-Response Questions 2023","","2023 AP® Computer Science A Section II provides four free-response questions with an emphasis on showing work and writing program segments in Java. The included prompt focuses on the AppointmentBook class for scheduling teacher appointments within eight numbered class periods and reserving consecutive available minutes. It requires implementing findFreeBlock to locate the earliest contiguous free interval of a requested duration using helper logic that checks minute availability. Examples specify expected return values and constraints for valid appointment blocks.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":20,"@type":76,"position":81},"https://docshare.wps.com/document/exam/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/ap-computer-science-a-section-ii-free-response-questions-2023/314871/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/ap-computer-science-a-section-ii-free-response-questions-2023/314871.png","ImageObject",300,407,{"name":92,"@type":93},"Mali","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-10-31","2026-09-20",true,{"@type":102,"interactionType":103,"userInteractionCount":52},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What are the key scheduling constraints for appointments in the AppointmentBook class?","Question",{"text":112,"@type":113},"Appointments must be scheduled within a single period, start and end within that same period, and use a consecutive block of minutes large enough for the requested duration. The period is numbered 1–8 and minutes are numbered 0–59.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What does findFreeBlock(period, duration) return if a suitable free block exists?",{"text":117,"@type":113},"It returns the first minute of the earliest consecutive free block of length duration within the specified period. If no such block exists, it returns -1.",{"name":119,"@type":110,"acceptedAnswer":120},"How should helper method isMinuteFree be used in implementing findFreeBlock?",{"text":121,"@type":113},"findFreeBlock must call isMinuteFree to determine whether each minute is available for inclusion in a new appointment. Only minutes where isMinuteFree returns true can be part of the free block.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},314871,1790050477,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":19,"category_name":20,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":52,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":56,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":143,"read_time":144,"preview_page_count":4},2336475104362,"https://ap-avatar.wpscdn.com/avatar/22000c4c46a41b752dd?x-image-process=image/resize,m_fixed,w_180,h_180&k=1786595829695023868","2023  \nAP® Computer Science A Free-Response Questions  \n© 2023 College Board. College Board, Advanced Placement, AP, AP Central, and the acorn logo are registered trademarks of College Board. Visit College Board on the web: [collegeboard.org](collegeboard.org).  \n[AP Central is the official online home for the AP Program: apcentral.collegeboard.org](AP Central is the official online home for the AP Program: apcentral.collegeboard.org).  \nCOMPUTER SCIENCE A  \nSECTION II  \nTime—1 hour and 30 minutes  \n4 Questions  \nDirections: SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. You may plan your answers in this orange booklet, but no credit will be given for anything written in this booklet. You will only earn credit for what you write in the separate Free Response booklet.  \nNotes:  \n• Assume that the classes listed in the Java Quick Reference have been imported where appropriate.  \n• Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied.  \n• In writing solutions for each question, you may use any of the accessible methods that are listed in classes defined in that question. Writing significant amounts of code that can be replaced by a call to one of these methods will not receive full credit.  \nGO ON TO THE NEXT PAGE.  \n© 2023 College Board.  \nVisit College Board on the web: [collegeboard.org](collegeboard.org).  \n1. This question involves the AppointmentBook class, which provides methods for students to schedule appointments with their teacher. Appointments can be scheduled during one of eight class periods during the school day, numbered 1 through 8. A requested appointment has a duration, which is the number of minutes the appointment will last. The 60 minutes within a period are numbered 0 through 59. In order for an appointment to be scheduled, the teacher must have a block of consecutive, available minutes that contains at least the requested number of minutes in a requested period. Scheduled appointments must start and end within the same period.  \nGO ON TO THE NEXT PAGE.  \n© 2023 College Board.  \nVisit College Board on the web: [collegeboard.org](collegeboard.org).  \nThe AppointmentBook class contains two helper methods, isMinuteFree and reserveBlock. You will write two additional methods of the AppointmentBook class.  \npublic class AppointmentBook  \n{  \n/**  \n* Returns true if minute in period is available for an appointment and returns  \n* false otherwise  \n* Preconditions: 1 \u003C= period \u003C= 8 ; 0 \u003C= minute \u003C= 59 */  \nprivate boolean isMinuteFree(int period, int minute)  \n{ /* implementation not shown */ }  \n/**  \n* Marks the block of minutes that starts at startMinute in period and  \n* is duration minutes long as reserved for an appointment  \n* Preconditions: 1 \u003C= period \u003C= 8 ; 0 \u003C= startMinute \u003C= 59 ;  \n* 1 \u003C= duration \u003C= 60 */  \nprivate void reserveBlock(int period, int startMinute, int duration){ /* implementation not shown */ }  \n/**  \n* Searches for the first block of duration free minutes during period, as described in  \n* part (a) . Returns the first minute in the block if such a block is found or returns -1 if no  \n* such block is found.  \n* Preconditions: 1 \u003C= period \u003C= 8; 1 \u003C= duration \u003C= 60 */  \npublic int findFreeBlock(int period, int duration)  \n{ /* to be implemented in part (a) */ }  \n/**  \n* Searches periods from startPeriod to endPeriod, inclusive, for a block  \n* of duration free minutes, as described in part (b) . If such a block is found,  \n* calls reserveBlock to reserve the block of minutes and returns true ; otherwise  \n* returns false.  \n* Preconditions: 1 \u003C= startPeriod \u003C= endPeriod \u003C= 8 ; 1 \u003C= duration \u003C= 60 */  \npublic boolean makeAppointment(int startPeriod, int endPeriod,  \nint duration)  \n{ /* to be implemented in part (b) */ }  \n// There may be instance variables, constructors, and methods that are not shown.  \n}  \nGO ON TO THE NEXT PAGE.  \n© 2023 College","cbCaija9u1iddUIM","https://ap.wps.com/l/cbCaija9u1iddUIM","pdf",518142,"English","# Question 1\n## AppointmentBook scheduling model\n## Implement findFreeBlock (part a)\n## Return rules and example cases","[{\"question\":\"What are the key scheduling constraints for appointments in the AppointmentBook class?\",\"answer\":\"Appointments must be scheduled within a single period, start and end within that same period, and use a consecutive block of minutes large enough for the requested duration. The period is numbered 1–8 and minutes are numbered 0–59.\"},{\"question\":\"What does findFreeBlock(period, duration) return if a suitable free block exists?\",\"answer\":\"It returns the first minute of the earliest consecutive free block of length duration within the specified period. If no such block exists, it returns -1.\"},{\"question\":\"How should helper method isMinuteFree be used in implementing findFreeBlock?\",\"answer\":\"findFreeBlock must call isMinuteFree to determine whether each minute is available for inclusion in a new appointment. Only minutes where isMinuteFree returns true can be part of the free block.\"}]","AP® Computer Science A - Section II Free-Response Questions 2023 | PDF",1789901991,48]