<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Java block sheet by Marius Magnussen</title>
      <link>https://padlet.com/marius15/yzxrqa1pq2ys</link>
      <description>Simplifying a problem.</description>
      <language>en-us</language>
      <pubDate>2018-02-06 00:54:37 UTC</pubDate>
      <lastBuildDate>2018-02-06 01:26:16 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>Account</title>
         <author>marius15</author>
         <link>https://padlet.com/marius15/yzxrqa1pq2ys/wish/228404771</link>
         <description><![CDATA[<pre>package Oppgave4;

import java.util.ArrayList;
import java.util.Calendar;

class Account {
	ArrayList&lt;Transaction&gt; transaction = new ArrayList&lt;&gt;();
	int id;
	double Balance;
	static double AnnualInterestRate;
	String name;
	Calendar dateCreated = Calendar.getInstance();

	public Account(String name, int id, double Balance) {
		this.name = name;
		this.id = id;
		this.Balance = Balance;
		Account.AnnualInterestRate = 1;

	}
// I need to log transactions in this ArrayList.
	public ArrayList&lt;Transaction&gt; getTransactions(){
		return transaction;
	}
	
	public double getAnnualInterestRate() {

		return AnnualInterestRate;

	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public double getBalance() {
		return Balance;
	}

	public void setBalance(double Balance) {
		this.Balance = Balance;
	}

	public Calendar getDateCreated() {

		return dateCreated;

	}

	public void setAnnualInterestRate(double AnnualInterestrate) {
		Account.AnnualInterestRate = AnnualInterestrate;
	}

	public double getMonthlyInterest() {
		return Balance * (AnnualInterestRate / 1200);
	}

// I realize that i have to build in the Transaction class to withdraw.
	public boolean withdraw(double withdraw) {
		boolean lykkes = (withdraw &lt;= Balance &amp;&amp; withdraw &gt; 0);
		if (lykkes) {
			Balance -= withdraw;
			
		}
		return lykkes;
	}
// I realize that i have to build in the Transaction class to deposit.
	public boolean deposit(double deposit) {
		boolean lykkes = (deposit &gt; 0);
		if (lykkes) {
			Balance += deposit;
		}
		return lykkes;
	}
}

<br></pre>]]></description>
         <enclosure url="" />
         <pubDate>2018-02-06 00:57:33 UTC</pubDate>
         <guid>https://padlet.com/marius15/yzxrqa1pq2ys/wish/228404771</guid>
      </item>
      <item>
         <title>Transaction</title>
         <author>marius15</author>
         <link>https://padlet.com/marius15/yzxrqa1pq2ys/wish/228404935</link>
         <description><![CDATA[<pre>package Oppgave4;

import java.util.Date;

public class Transaction {
	double amount, balance;
	String description;
	Date date;
	char type;

	Transaction(char type,double amount, double balance, String description) {
		this.type = type;
		this.amount = amount;
		this.balance = balance;
		this.description = description;
	}


	public String getDescription() {
		return description;
	}

	public Date getDate() {
		//Gets returned when Transaction is used.
		return date;
	}

	public double getBalance() {
		return balance;
	}

	public double getAmount() {
		return amount;
	}
	public char getType() {
		return type;
	}

	public String toString() {
		return String.format("Balance: %.2f, Amount: %.2f, Date:", this.getBalance(), this.getAmount(), this.getDate() );
	}
}</pre><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2018-02-06 00:58:25 UTC</pubDate>
         <guid>https://padlet.com/marius15/yzxrqa1pq2ys/wish/228404935</guid>
      </item>
      <item>
         <title>testAccount</title>
         <author>marius15</author>
         <link>https://padlet.com/marius15/yzxrqa1pq2ys/wish/228405567</link>
         <description><![CDATA[<pre>package Oppgave4;

public class Accounttest {

	public static void main(String[] args) {
		
 
     
 
 
 
 
 
 
 
 
 
 
 
 







	}

}
<br></pre>]]></description>
         <enclosure url="" />
         <pubDate>2018-02-06 01:01:58 UTC</pubDate>
         <guid>https://padlet.com/marius15/yzxrqa1pq2ys/wish/228405567</guid>
      </item>
   </channel>
</rss>
