nikhilc3 / csa

MIT License
0 stars 0 forks source link

FRQ Assosication - Nikhil #4

Open nikhilc3 opened 4 months ago

nikhilc3 commented 4 months ago

FRQ # 1

The FRQ from the AP CSA exam was about working with array and ArrayList, 1d and 2d, structures to manipulate and analyze data. It focused on creating methods to sum array elements and checking for the diversity of row sums in a two-dimensional array.

The Person class from my project manages user-related data and can relate to the FRQ in ways like of handling objects:


@ManyToMany(fetch = EAGER)
private Collection<PersonRole> roles = new ArrayList<>();

In this code, roles is an ArrayList that manages PersonRole objects, showing the concept of managing a collection of objects which is related to handling arrays and ArrayLists in the FRQ. Just like in the FRQ where I would check for the diversity of elements, in our project, I might need to ensure that each Person has a diverse set of roles, avoiding duplicates, and managing them efficiently.

Here is part of my comment class:


// Comment class snippet managing comment data
@Entity
public class Comment {

    private Timestamp timestamp;

}

Here, the Comment class uses fields to represent structured data and this is similar how arrays are used in the FRQ to structure numerical data. The timestamp field for example can be compared to elements in an array that are being analyzed or manipulated showing object-oriented.

FRQ # 2

For FRQ #2 of the AP CSA exam, the task was to create a class that simulates a word guessing game where the player's guess results in hints. This class required methods to determine if a guessed letter was in the hidden word and in the correct location or just present in the word.

The Comment class from my project that I coded also manages data like this but obviously not in the way of a guessing game:


@Entity
public class Comment {

    private String text;

        public Comment() {
    }

    public Long getId() {
        return id;
    }

    public String getUserName() {
        return userName;
    }

    public String getGameName() {
        return gameName;
    }

    public String getText() {
        return text;
    }

    // rest of it on project

}

This class is to manage the comments of the users in the fantasy basketball page. It relates to the FRQ's focus on class creation and handling string data. In both the FRQ and my Comment class, the similarity is on manipulating string data even though it is for storing and displaying user comments. In general, the skills applied in the FRQ directly translate to handling the Comment class in my project. The FRQ's getHint method and the class's getters and setters both are to process and provide access to the data that is in the object.

FRQ # 3

I could not find any implementation of sparse arrays in my project but here is something we could have done to implement it in the section I coded, the comment section. Implementing a sparse array concept into my Comment class could be useful if I had a situation where I needed to manage a large number of comments meaning a lot of people using the website and chatting, but also expect many of them to be empty at any given time. For example, tracking comments across multiple games in a tournament, but not all games receive comments.

Instead of using a regular 2D array that would put memory for all possible comment slots (some which might be empty), I could use a structure similar to a sparse array to store only the comments that exist. This would be much more memory efficient.

Each Comment object would have the actual comment text and additional data like a timestamp or game name and have like an ArrayList or a HashMap that only stores these objects when a comment is made. When retrieving comments, the code could check for the existence of a comment by game name or timestamp, similar to checking for a non-zero value at a index in a sparse array.

FRQ # 4

The FRQ worked on making an interface (NumberGroup), implementing it in a class (Range), and using control structures within these implementations to check the presence of an integer in a group or range.

The LogisticRegressionModel class in our project shows the behavior and logic for a logistic regression model.

public void train(List<Double> x_train, List<Double> y_train) {
    // Training logic
}

public List<Double> predict(List<Double> x_test) {
    // Prediction logic
}

private double sigmoid(double z) {
    // Sigmoid function for logistic regression
}

Relationship to FRQ: Similar to how the FRQ required an implementation of the contains method, the train and predict methods are showing the regression model's behavior. Just as NumberGroup interface shows the structure for the groups of numbers and their behavior the RegressionModel class (which LogisticRegressionModel extends) defines the regression models.

Overall Reflection:

Relating my project to the FRQ really helped me have a deeper understanding of everything as I am able to relate it to real life situations as of building our website. This helps me to really understand the concepts in order to ace the AP Exam but it also made me realize that I have a lot of weakness I need to work on and what weakness to work on. During FRQ 3, I encountered challenges with implementing and manipulating sparse array structures, a concept that was initially challenging. Storing and accessing non-zero elements in an efficient manner, as outlined in the FRQ, were not immediately coming to me and were a little hard for me to understand. I was absolutely stuck so I resorted to ask ChatGPT to help me understand it, instead of finding the answer on google, then once I understood it, the concept became clearer and I was able to do it. The primary problem I faced was the removal of a specific column from the sparse array and appropriately updating the array structure, I just did not understand that too well. I will definitely work on this for sure and also another thing was timing which I need to improve on, as the 15 minute limit was exceeded on some of them for sure as I was taking time to think about it. Moving forward, I aim to focus on enhancing my efficiency with array and ArrayList manipulations, as these are fundamental skills that apply to both the exam and practical programming tasks. During trimester 3, I will lay out a solid plan in order to attack the concepts that I need help with starting with fully finishing the college board videos on the AP CSA exam to fill in any gaps that I am missing. I will also implement PBL by relating the FRQ to the projects we are doing as seen how helpful it is in this case.

Emaad-Mir commented 4 months ago

Emaad's Crossover Review of Nikhil

FRQ final 9/8 on indicators

10%, FRQ live 1/.8 on indicators... Issue/Live Review (2 minutes on live review)

45% FRQ code 4/3.6 on indicators... FRQ is assigned here

45% FRQ associations 4/3.6 on indicators. Show how FRQs or principles of FRQs are incorporated into to your final project.

Grade earned on associations: 4/3.6 -> turned this in before Mr. Mortensen's cutoff comment

Other Comments: FRQ 1

FRQ 2

FRQ 3

FRQ 4

Reflection

Grade earned on FRQ code: 3.8/3.6 (0.9 pt for each FRQ, 1/0.9 earned on FRQ 1 and 3 and 0.9/0.9 earned on FRQ 2 and 4) -> turned this in before Mr. Mortensen's cutoff comment

Other comments: For all 4 FRQs:

Total: 4+3.8=7.8/7.2