CPT OUTLINE

The fullstack comments section is a web application designed to allow users to leave comments on a webpage. The program’s overall purpose is to provide an interactive platform for website visitors to share their thoughts and opinions.

The functionality demonstrated in the video includes adding a comment to the webpage, viewing previously posted comments, and deleting comments. The input for the program demonstrated in the video includes text input by the user when creating a new comment, while the output includes the display of comments on the webpage.

One of the ways the program manages complexity is through the use of lists. In one program code segment, data is stored in a list by appending new comments to the end of the list. The second program code segment shows how the existing data in the list is used, such as accessing multiple elements in the list to display previously posted comments.

The name of the list used in the program is ‘comments’. The data contained in the list represent individual comments posted by users on the webpage. The selected list manages complexity in the program by providing a way to store and access a potentially large number of comments without the need for multiple variables.

The student-developed procedure in one of the program code segments is called ‘insert_comment’. This procedure takes in parameters such as the comment text, the commenter’s name, and the comment’s date and time. The procedure then appends the new comment to the ‘comments’ list, effectively adding it to the webpage. The algorithm implemented in the ‘insert_comment’ procedure involves sequencing, selection, and iteration. The procedure first checks that the comment text is not empty, then checks that the commenter’s name is not empty, and finally adds the comment to the ‘comments’ list.

The ‘insert_comment’ procedure contributes to the overall functionality of the program by allowing users to add new comments to the webpage. When called, the procedure checks that the comment and name fields are not empty and adds the new comment to the ‘comments’ list. The algorithm implemented in the ‘insert_comment’ procedure works by first checking if the comment and name fields are not empty. If they are not empty, the procedure creates a new comment object with the input data and appends it to the ‘comments’ list.

In written response 3d, two calls to the ‘insert_comment’ procedure are described. In the first call, the comment text field is left blank while a name and date/time are provided. The condition tested by this call is whether the comment text field is empty or not. The result of this call is that the comment is not added to the ‘comments’ list. In the second call, both the comment text and name fields are provided while the date/time field is left blank. The condition tested by this call is whether the date/time field is empty or not. The result of this call is that the comment is added to the ‘comments’ list. Overall, the fullstack comments section meets the College Board’s requirements for APCSP by providing a functional web application that uses programming concepts such as lists and procedures to manage complexity and achieve its purpose.

CPT OUTLINE