I solidified my knowledge on classes, constructors (both regular and no-arg constructors), static variables, class methods, and encapsulation. It was a lot to take in at first, but after reading the Intro to Java textbook, and a few tutorials online it all made sense.
I meant to post this sooner but working, coding, and my classes have kept me busy. For the past two days I’ve been working on a program called Test Account.
In this program I created a class called Account where I gave it a private id, balance, annual interest rate, and date changed. Since the point of the program is to function like an actual bank account the balance needs to be updated with deposit and withdrawals. The data items will need to be private and accessed/mutated through getters and setters. Additionally, I had to create methods to address the monthly interest, annual interest, deposits, and withdrawals on the account.
I used the scanner object to get input from the user. I stored these inputs into variables which I would later use as arguments for my getters, and methods.
Finally I returned and printed the updated balance, monthly interest, annual interested and date created to the user.
If you are taking Java or have the Intro to Programming in Java text book by Daniel Liang 10e try it out. It should be at the end of chapter 9. My program is probably a bit different because my professor likes to customize it, but it’s should otherwise be fairly similar..,