I am working on an app for my AP Computer Science Principles Create Portion, and I cannot get the app to run without the end result number showing as NaN, which I assume means “Not a Number”. If anybody could help that would be amazing.
Another school day! Took my first notes for APCompSci, in preparation for my first coding project for review ^-^ this was followed by me fighting with my compiler while at home and figuring out how the hell to determine prime numbers without having a mile of code. Not fun. Still don’t know if it works.
Other than that, I had to help my family after school get prepared for AC installers to come tomorrow, and did some writing during the school day! I may even be able to finish chapter 1 tomorrow if I try. I could try to do a bit more work before sleep, but one of my main goals for this year is to not work 24/7, so I’m going to keep it easy for now. It’ll just mean extra math tomorrow but whatever.
public int centeredAverage(int[] nums) {
int min = nums[0]; // initial variables to hold min/max/total values
int max = nums[0];
int total = 0;
for (int i = 0; i < nums.length; i++) // checks for min/max values
{
min = Math.min(min, nums[i]);
max = Math.max(max, nums[i]);
}
for (int i = 0; i < nums.length; i++) // adds all array values
{
total += nums[i];
}
return (total - min - max)/(nums.length - 2); // subtracts the largest & smallest values
// and divides it by the total numbers minus 2
}
09/12/17 I left my laptop to go take a shower and came back to my cat using it as a heater. She then growled when I tried to move her. School is still out because of Hurricane Irma, but I'm safe! There was no damage to my school, so I return tomorrow. All of my instructors have implemented extension plans, except for one, who apparently thinks you can write an essay through a hurricane. Happy Tuesday and, if your area is still flooded, stay safe!
In the first week or so of my senior year of high school, my class’s projected valedictorian requested entrance into AP Computer Science. At the time, students were required to have taken a two-year sequence of introductory computer science courses as a prerequisite to AP Computer Science. Consequently, Mr. Valedictorian caused an uproar when the school administration allowed him to bypass the rules and enroll in the class. To placate those in a tizzy, the school administration later declared that he instead must pass a comprehensive exam in order to gain entry to the course–and that any other interested students may do so as well. At the time, I had already taught myself HTML, CSS, and some Javascript. I built websites from scratch and was nearly competitive about it. Despite one failed attempt at getting Python to run on my computer, I knew that if anyone could pass that test, it would be me.
Fast forward to several days later in a noisy computer lab were I found myself the sole female in my overcrowded public high school’s AP Computer Science class using Java to print “Hello World!”. Immediately, I realized that this situation was special: I had climbed my way into a boy’s club. But I knew I was out of place both because of my sex and because of the way I had bypassed the course prerequisites unlike nearly all of the other students. But I thought, maybe I could prove myself. And initially, things were fine. If I ever had trouble with homework, the guys in class would more or less just do it for me. Now that I am older, I understand what a disservice that was. I learned nothing. And maybe I unknowingly fell victim to stereotype threat. I figured maybe I didn’t belong in the class anyway, and I knew I was different. Moreover, the tests in the class were open book, so I really figured out a way to achieve high scores without retaining much. Eventually, even though I got along with many of my classmates in AP Computer Science, I found myself trying really hard to be liked at all times. I pretended to love TV shows and movies that I thought were dumb and smiled even when some of the guys were actually being creepy. For example, one classmate who said vile things about his grandmother would also only refer to me as “cat girl” and regularly drew images of me as an anime half-human, half-cat character.
I stopped making websites once I finished that class. I never thought about coding again until ten years later when, one day, I had a large block of free time and remembered that I had always wanted to learn Python as a teen.
public int bigDiff(int[] nums) {
int min = nums[0]; // declare variables to hold values to double check
int max = nums[0];
for (int i = 0; i < nums.length; i++)
{
min = Math.min(min, nums[i]); // checks between current min and value at i
max = Math.max(max, nums[i]);
}
return (max - min); // returns int value of difference
}