[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-314691-105":59,"doc-detail-314691-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-principles-session-1-mcq","AP Computer Science Principles Session 1 - MCQ","","2024 AP Daily: Practice Sessions AP Computer Science Principles Session 1 provides eight multiple-choice questions covering core programming concepts and algorithmic reasoning. Topics include effects of code-line changes on program results, interpreting outputs of simple programs, comparing two programs’ behavior for summation, analyzing a grid robot procedure, identifying failing test inputs for max-selection logic, evaluating a REPEAT UNTIL procedure with conditional returns, comparing two maximum-finding algorithms, and selecting between linear and binary search for sorted data.",{"@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-principles-session-1-mcq/314691/",{"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-principles-session-1-mcq/314691.png","ImageObject",300,407,{"name":92,"@type":93},"8796093062539","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-10-31","2026-09-20",true,{"@type":102,"interactionType":103,"userInteractionCount":39},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"Which change to the code segment will NOT affect the results?","Question",{"text":112,"@type":113},"Answer choices analyze how modifying Line 3 changes the computed value assigned to b in either the IF or ELSE branch. The correct option is the one that leaves the final results unchanged when the segment executes.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How is the procedure Mystery in Question 6 supposed to return true or false?",{"text":117,"@type":113},"The procedure repeatedly subtracts 2 from number until number ≤ 0, then returns true only when number equals 0; otherwise it returns false.",{"name":119,"@type":110,"acceptedAnswer":120},"What general statement is true about linear vs. binary search in a sorted list?",{"text":121,"@type":113},"The options compare assumptions and performance trends. The correct choice states that binary search’s advantage over linear search generally grows as the list size increases.","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},314691,1790511572,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":66,"doc_module":4,"category_id":19,"category_name":20,"doc_title":65,"doc_description":67,"doc_content":133,"file_id":134,"file_url":135,"file_type":136,"file_size":137,"view_count":39,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":29,"language":138,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":139,"faqs":140,"seo_title":141,"seo_description":67,"update_tm":142,"read_time":143,"preview_page_count":4},8796093062539,"2024 AP DAILY: PRACTICE SESSIONS  \nAP Computer Science Principles Session 1 – MCQ  \n1. Consider the code segment below.  \nLine 1: IF (a = 0)  \nLine 2: {  \nLine 3: b ← a + 10  \nLine 4: }  \nLine 5: ELSE  \nLine 6: {  \nLine 7: b ← a + 20  \nLine 8: }  \nWhich of the following changes will NOT affect the results when the code segment is executed?  \nA. Change Line 3 to b ← 10  \nB. Change Line 3 to a ← b+10  \nC. Change Line 3 to b ← 20  \nD. Change Line 3 to a ← b+20  \nSource: AP Practice Exam; Taken from: APClassroom  \n2. In the program below, y is a positive integer (e.g. , 1, 2, 3,…) .  \nWhat is the value of result after running the program?  \nA. y + 3  \nB. 3y  \nC. y3  \nD. 3y  \n3. Programs I and II below are each intended to calculate the sum of the integers from 1 to n. Assume that n is a positive integer (e.g. , 1, 2, 3,…) .  \nSource: AP Practice Exam; Taken from: APClassroom  \nWhich of the following best describes the behavior of the two programs?  \nA. Program I displays the correct sum, but program II does not.  \nB. Program II displays the correct sum, but program I does not.  \nC. Both program I and program II display the correct sum.  \nD. Neither program I nor program II displays the correct sum.  \n4. The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the bottom-left square of the grid and facing toward the top of the grid.  \nCode for the procedure Mystery is shown below. Assume that the parameter p has been assigned a positive integer value (e.g. , 1, 2, 3,…) .  \nWhich of the following shows a possible result of calling the procedure?  \nSource: AP Practice Exam; Taken from: APClassroom  \nA.  \nB.  \nC.  \nD.  \nSource: AP Practice Exam; Taken from: APClassroom  \n5. The following code segment is intended to set max equal to the maximum value among the integer variables x, y, and z. The code segment does not work as intended in all cases.  \nWhich of the following initial values for x, y, and z can be used to show that the code segment does not work as intended?  \nA. x = 1, y = 2, z = 3  \nB. x = 1, y = 3, z = 2  \nC. x = 2, y = 3, z = 1  \nD. x = 3, y = 2, z = 1  \n6. In the procedure Mystery below, the parameter number is a positive integer.  \nPROCEDURE Mystery (number)  \n{  \nREPEAT UNTIL (number ≤ 0)  \n{  \nnumber ← number – 2  \n}  \nIF (number = 0)  \n{  \nRETURN (true)  \n}  \nELSE  \n{  \nRETURN (false)  \n}  \n}  \nSource: AP Practice Exam; Taken from: APClassroom  \nWhich of the following best describes the result of running the procedure Mystery?  \nA. The procedure returns true when the initial value of number is 2, and it otherwise returns false.  \nB. The procedure returns true when the initial value of number is greater than 2, and it otherwise returns false.  \nC. The procedure returns true when the initial value of number is even, and it otherwise returns false.  \nD. The procedure returns true when the initial value of number is odd, and it otherwise returns false.  \n7. An algorithm will be used to identify the maximum value in a list of one or more integers. Consider the two versions of the algorithm below.  \nAlgorithm I : Set the value of a variable max to − 1. Iterate through the list of integer values. If a data value is greater than the value of the variable max, set max to the data value.  \nAlgorithm II : Set the value of a variable max to the first data value. Iterate through the remaining values in the list of integers. If a data value is greater than the value of the variable max, set max to the data value. Which of the following statements best describes the behavior of the two algorithms?  \nA. Both algorithms work correctly on all input values.  \nB. Algorithm I always works correctly, but Algorithm II only works correctly when the maximum value is not the first value in the list.  \nC. Algorithm II always works correctly, but Algorithm I only works correctly when the maximum value is greater than or equal to − 1.  \nD. Neither algorithm will correctly identify the m","cbCaih6UXBROgqac","https://ap.wps.com/l/cbCaih6UXBROgqac","pdf",931202,"English","# AP Computer Science Principles Session 1 – MCQ\n## Question 1\n## Question 2\n## Question 3\n## Question 4\n## Question 5\n## Question 6\n## Question 7\n## Question 8","[{\"question\":\"Which change to the code segment will NOT affect the results?\",\"answer\":\"Answer choices analyze how modifying Line 3 changes the computed value assigned to b in either the IF or ELSE branch. The correct option is the one that leaves the final results unchanged when the segment executes.\"},{\"question\":\"How is the procedure Mystery in Question 6 supposed to return true or false?\",\"answer\":\"The procedure repeatedly subtracts 2 from number until number ≤ 0, then returns true only when number equals 0; otherwise it returns false.\"},{\"question\":\"What general statement is true about linear vs. binary search in a sorted list?\",\"answer\":\"The options compare assumptions and performance trends. The correct choice states that binary search’s advantage over linear search generally grows as the list size increases.\"}]","AP Computer Science Principles Session 1 - MCQ | PDF",1789901650,15]