

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


...epos\BSIT3-2\Class_Activity\Class_Activity\Program.cs 1 //Rivas, Joy B. //BSIT 3- 2 using System; public class Account { int id = 0; double balance = 0; double annualInterestRate = 0; DateOnly dateCreated = new DateOnly(2022, 06, 02); public Account(int ID, double bal, double InterestRateValue) { balance = bal; id = ID; annualInterestRate = InterestRateValue; } public int getID() { return id; } public double getBalance() { return balance; } public double getannualInterestRate() { return annualInterestRate; } public DateOnly getdateCreated() { return dateCreated; } public double getMonthlyInterestRate() { double interest = annualInterestRate / 12; return interest; } public void withdraw(double withdrawAmount) { balance = balance - withdrawAmount; }
...epos\BSIT3-2\Class_Activity\Class_Activity\Program.cs 2 public void deposit(double depositAmount) { balance = balance + depositAmount; } public void displayBalance() { Console.WriteLine("Account Balance: Php {0}", getBalance()); } public void displayMonthlyInterest() { Console.WriteLine("Monthly Interest: {0}%", getMonthlyInterestRate()); } public void displaydateCreated() { Console.WriteLine("Account was created on: {0}", getdateCreated()); } public static void Main(String[] args) { Account myAccount = new Account(1122, 20000, 4.5); myAccount.withdraw(2500); myAccount.deposit(3000); myAccount.displayBalance(); myAccount.displayMonthlyInterest(); myAccount.displaydateCreated(); } }