CAPE Computer Science Unit 2 · 2005 · Paper 1 · Question 13
An Account object has two instance variables, accNum (an integer value) and balance (a floating point value), and the following methods: - deposit: accepts a parameter, amount (a floating point value) and increases the balance by amount - withdraw: accepts a parameter, amount (a floating point value) and decreases the balance by amount - getBalance: returns the current balance in the account Using an object-oriented programming language of your choice, write the code to define the Account class.
The mark scheme is shown once you've answered.
Practise this question