DEV Community

Anh Luong
Anh Luong

Posted on

Assignment 1

I encountered some difficulties while working on Assignment 1 for SE 371. Since this assignment is short and easy, I didn't struggle significantly but I will discuss notable troubles I had completing this assignment.

The most notable struggle I had was creating a new project in java. I have created a new directory for two classes I've taken previously, but I was still having trouble for some reason. I remembered my previous data structures professor had posted a tutorial on how to create a new java project. So I followed the step-by-step video and was able to solve this problem with ease.

The next problem involved writing the Fibonacci sequence program. I had trouble figuring out the way to shift the index down on to the new number after retrieving the sum from the two numbers before. I resolved this by writing down the steps mathematically on a sheet of paper rather than keep trying to work it out in my head. Seeing the variables and numbers on paper made it easier to code the steps that are the heart of the problem (indexing the numbers and totaling them). Next, I created a global int variable to keep track of where the program was in the Fibonacci sequence. I initially set it at zero because that's the standard for many coding problems. My program kept printing out the incorrect number, so I wrote down the first few numbers in the Fibonacci sequence and the sequence index that corresponded to each number. After seeing it all on paper, I realized my program was printing out one higher than the nth sequence entered by the user. I soon saw my mistake lying in the placeholder variable. Setting the variable to zero makes the program do an extra sequence. I solved this obstacle by setting it to 1 since the sequence starts at F0 and F1 rather than just F0.

My feelings towards SE 371 involves lots of nervousness but also some excitement. I have never really taken a course like this before so it will be a big learning experience for me. I expect to gain insight on working as a team and the professional environment when working as a software developer. I plan on applying for internships before my junior year ends so I'm excited to learn more about the workforce through this class!

Top comments (0)