Question: QUESTION 1 (25 MARKS) Design a class named Account that contains: A private int data field named id for the account (default o). A private

QUESTION 1 (25 MARKS) Design a class named Account that contains: A private int data field named id for the account (default o). A private double data field named balance for the account (default o). A private double data field named annuallnterestRate that stores the current interest rate (default 0). Assume all accounts have the same interest rate. A private Date data field named dateCreated that stores the date when the account was created. A no-arg constructor that creates a default account. A constructor that creates an account with the specified id and initial balance. The accessor and mutator methods for id, balance, and annuallnterest Rate. The accessor method for dateCreated, A method named getMonthlyInterestRate() that returns the monthly interest rate. A method named getMonthlyInterest that returns the monthly interest. A method named withdraw that withdraws a specified amount from the account. A method named deposit that deposits a specified amount to the account. Implement the class in Java as required by the design above. (Hint: The method getMonthlyInterest() is to return monthly interest, not the interest rate. Monthly interest is balance * monthlyInterest Rate and monthlyInterest Rate is annuallnterestRate / 12. Note that annualInterestRate is a percentage, c.g., like 4.5%. You need to divide it by 100.) Write a test program that creates an Account object with an account ID of 1122, a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the deposit method to deposit $3,000, and print the balance, the monthly interest, and the date when this account was created. Assignment Marking Scheme 1/3 marks - Proper documentation and readability of the program - Header documentation includes: Course Name, Student name, Student number, Assignment number and date completed. - There must be a general description of the purpose of the method/function used. - Appropriate comments: where necessary, within the method function, there should be inline comment descriptions of declaration of variables, statements, control structures and etc. to improve the readability of the program. - Properly named variables: well-chosen descriptive variable names make it easier for readers or analysts to understand what the intent of the variable or what the system is doing. Example: payRate =5.0 as oppose to x=5. Properly named variable can also avoid naming collision. - Properly named method/function: method name should imply the intent of the method and what the method is doing. - All identifier names should follow standard naming convention in Java. - Proper indentation and spacing in program improves readability. 1/3 marks - Programming language knowledge and skills - Demonstrate the use of concepts in Java such as: object-orientation, interface, package, class, exception and etc., learnt in the class. - Demonstrate the use of basic programming concepts. - Use of features not presented in the class must be relevant and properly commented. - Program shows a clear understanding of programming concepts in general. - Good programming practices and skills 1/3 marks - Program compile and run with correct output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
