Develop console application to manage customers and accounts

Assignment Help C/C++ Programming
Reference no: EM131950101

OBJECT ORIENTED DEVELOPMENT PROJECT-

LEARNING OUTCOMES -

  • Apply object-oriented concepts including abstraction, encapsulation, inheritance, and polymorphism.
  • Solve programming problems using object-oriented techniques and the C# programming language.

PROJECT DESCRIPTION - You are required to develop a console application to manage customers and accounts using C#. Your application will include the following classes.

1. Customer - This class represents customers and has the following information

1.1. Attributes

  • First name: Customer's first name. This information is required1 and the attribute is a readable/writeable attribute.
  • Last name: Customer's last name. This information is required and the attribute is a readable/writeable attribute.
  • Address: Customer's address. This information is required and the attribute is a readable/writeable attribute.
  • Date of birth: Customer's date of birth. This information is required and the attribute is a readable/writeable attribute. You should use DateTime4 for the datatype of this attribute. Customer must be at age of 16 or above. For the sake of simplicity, only the year of birth will be considered. For example, given that the current year is 2018, only customers whose year of birth is 2002 or prior can be maintained in the application. You can get the current year via DateTime.Now.
  • Contact number: Customer's contact number. A contact number must contain exactly 10 digits. However, this attribute is not required and thus can be blank.
  • Email: Customer's email. This attribute is not required and thus can be blank.
  • List of accounts: Customer's accounts. Account class is described in section 2. You could use List5 to maintain the list of accounts. This attribute is a read-only attribute.

1.2. Methods

  • Constructor: This constructor receives input parameters including first name, last name, address, date of birth, contact, and email. Note that if customer does not have a contact number or email address, those fields will be set to blank.
  • Copy constructor: You need to implement a copy constructor. Please revisit Prac 4.1 for an example of copy constructors.
  • Add account: This method adds an account to the list of accounts. This method should receive only an account as input parameter.
  • Sum balance: This method returns the total balance of all accounts owned by the customer.
  • ToString: This method returns a string including first name, last name, address, date of birth, contact, email, and total balance. Total balance is the sum of the balances of all accounts owned by the customer. The total balance is required to be presented in 1 decimal digit, e.g. 2,510.5 (see Figure 1 attached). Please revisit Prac 4.1 for an example of ToString() method.

2. Account - This class represents accounts and has the following information.

2.1. Attributes

  • ID: Account's ID. This attribute is required and is read-only. It cannot be set manually but generated automatically. In particular, the first account (in the system) will have ID = 1, accounts opened after that will have ID = 2, 3, etc. Hint: ID should be declared as static and its datatype should be unsigned int (uint) or unsigned long (ulong).
  • Opened date: Account's opened date. This information is required and is read-only. The opened date of an account must be on or before the current date (obtained using DateTime.Now). Hint: Comparison of DateTime variables can be performed using DateTime.Compare.
  • Closed date: Account's closed date. This attribute does not require a value if the account is still active and is set by the date the account is closed otherwise. This attribute is a read-only attribute. This attribute is set indirectly by calling method "Close" (described in Section 2.2).
  • Active: Account's status. This attribute represents account's status that can be active or inactive. This is a read-only attribute. You could use bool for the datatype of this attribute. This attribute is set indirectly by calling "Close" method (described in Section 2.2).
  • Balance: Account's balance. This attribute requires a value with 0 for default value. Balance must be equal or greater than 0. This is a readable/writable attribute.
  • Owner: Account's owner. Account's owner is a Customer object. This attribute is read-only and is given via constructor's parameters.

2.2. Methods

Constructors: There are two constructors

  • Constructor 1: This constructor receives input including an owner, an opened date, and an initial balance. In this constructor, the opened date and initial balance need to be validated (see description of opened date and balance in section 2.1). When an account is created its "Active" attribute needs to be set to true.
  • Constructor 2: This constructor has less parameters. In particular, it receives input including an owner and an initial balance. In this constructor, the opened date is set by the current date. Note that initial balance also needs to be validated. When an account is created its "Active" attribute needs to be set to true. Constructor 1 should be invoked in Constructor 2. See Prac 4.1 for an example of calling a constructor from another constructor.

Close: This method closes the account. In the method, "Active" is updated and "Closed date" is set to the current date. Note that Close method is only applied to active accounts.

Transfer: This method receives input as an account and amount of money and aims to transfer that amount from the current account to the input account. For example, let a and b be two accounts, a.Transfer(b, 1000) will transfer $1,000 from account a to account b. However, this method acts differently depending on the account types (see more details in Section 3 and 4). Note that Transfer method is only applied to active accounts.

Calculate interest: This method calculates and results in the interest of the account. This method acts differently depending on the account types (see more details in Section 3 and 4).

Update balance: This method is called when the balance needs to be updated. We assume that in the end of each month, the balance is re-calculated and updated based on the interest as follow, new balance = old balance + interest. Thus, this method will need to call Calculate interest to fulfill its task.

ToString: This method returns a string including account's ID, opened date, balance, owner's name, and closed date (if the account has been closed). The balance is required to be presented in 1 decimal digit, e.g. 2,510.5 (see Figure 1 attached)

There are two types of accounts: Type1Account and Type2Account.

3. Type1Account - This is a sub-class of Account and contains the following information.

3.1. Attributes

  • Annual interest rate: The interest rate is fixed to 2.0 for all type 1 accounts and is a read-only attribute. Hint: this attribute should be static.

3.2. Methods

  • Constructors: Like Account class, this class has two constructors with similar parameters.
  • Deposit: This method receives an amount of money as input and adds this amount to the balance. Note that, this operation is only applied to active accounts and the deposit must be greater than 0.
  • Withdraw: This method receives an amount of money as input and deducts this amount from the balance. Like "Deposit" method, the withdrawal is only applied to active accounts and the withdrawn money must be positive and not exceed the balance.
  • Transfer: This method overrides the Transfer method declared in Account class, which transfers a given amount of money to a given account. The transferred amount of money must be greater than zero and cannot exceed the balance of the source account.
  • Calculate interest: This method overrides the Calculate interest method declared in Account class. The interest can be calculated using the formula below, Interest = (Annual interest rate / 365 / 100) * nDays * Balance where nDays is the number of days since the first day of the current month to the current day. If the account is opened after the first day of the current month, then nDays is the number of days since its opened day to the current day. For example, given March 29th, 2018 as the current date and if the account was opened on February 20th, 2018, then nDays = 29 - 1 = 28. If the account was opened on March 10th, 2018, then nDays = 29 - 10 = 19.

Hint: You could use Timespan class and Subtract method (of DateTime) to calculate difference between DateTime variables. For example, let d1 and d2 be two DateTime objects, the difference in months between d1 and d2 can be calculated as, TimeSpan span = d1.Subtract(d2).

4. Type2Account

4.1. Attributes

  • Monthly deposit: This type of account requires its owner to make a deposit monthly. Monthly deposit is the amount money that the owner deposits in the current month. This attribute is a readable/writable attribute. We assume that the owner makes this monthly.
  • Annual interest rate: Like Type1Account, this interest rate is fixed for all type 2 accounts and is a read-only attribute. However, its value is higher and is set to 3.0.
  • Deposit interest rate: This interest rate is fixed for all type 2 accounts. However, it is applied only to the Monthly deposit and is set to 4.0.

4.2. Methods

  • Constructors: Like Account class, this class has two constructors with similar parameters.
  • Transfer: This method overrides the Transfer method declared in Account class, which transfers a given amount of money to a given account. The transferred amount of money must be greater than zero and cannot exceed the balance of the source account. However, unlike Type1Account, a Type2Account can only transfer money to a Type1Account of the same owner. Hint: you could use GetType() and typeof for check the type of an account object. For example, let a be an account, we could check whether a is an instance of Type2Account by using this condition a.GetType() == typeof(Type2Account).
  • Calculate interest: This method overrides the Calculate interest method declared in Account class. The interest can be calculated using the formula below, Interest = (Annual interest rate / 365 / 100) * nDays * Balance + (Deposit interest rate / 365 / 100) * nDays * Monthly deposit where nDays is computed similarly as in the Calculate interest method of Type1Account.
  • Update balance: This method calls the UpdateBalance method in Account class and then set the Monthly deposit to 0.

5. Main method

You are to implement a Main method to test your classes. The Main method must include the following step (you MUST keep the same order),

a. Creating 3 customers (c1, c2, and c3) with the following information

c1: <First name: Arley, Last name: Praise, Address: 12 Hay Rd, Date of birth (DD/MM/YYYY): 02/10/1990

c2: <First name: Joseph, Last name: Abot, Address: 4/1 Mandy Pl, Date of birth (DD/MM/YYYY): 11/05/1970

c3: <First name: Rose, Last name: Magaret, Address: 30 Buxton St, Date of birth (DD/MM/YYYY): 06/07/1980

b. Creating 5 accounts (a1, a2, a3, a4, and a5) with the following information

a1 (Type1): <Owner: c1, opened date (DD/MM/YYYY): 01/02/2018, initial balance: $100>

a2 (Type2): <Owner: c1, opened date (DD/MM/YYYY): 15/02/2018, initial balance: $5,000>

a3 (Type1): <Owner: c2, opened date (DD/MM/YYYY): 20/03/2018>

a4 (Type2): <Owner: c3, opened date (DD/MM/YYYY): 04/03/2018, initial balance: $2,000>

a5 (Type2): <Owner: c3, initial balance: $3,000>. Note that when the opened date is not provided, it will be set to the current date.

c. Deposit -$200 to a1

d. Transfer $6,000 from a2 to a1

e. Transfer $2,000 from a2 to a1

f. Transfer $1,000 from a1 to a2

g. Set the monthly deposit for a2 to $200

h. Deposit $5,000 to a3

i. Withdraw $6,000 from a3

j. Transfer $1,000 from a3 to a1

k. Transfer $500 from a3 to a2

l. Set the monthly deposit for a4 to $1,000

m. Transfer $100 from a4 to a1

n. Set the monthly deposit for a5 to $1,500

o. Transfer $500 from a5 to a4

p. Calculate the interests of a1, a2, a3, a4, and a5 and display them on the console window

q. Update balance of a1, a2, a3, a4, and a5

r. Close a3 and a5

s. Display the information of a1, a2, a3, a4, and a5 by calling ToString() method of these accounts

t. Display the information of c1, c2, and c3 by calling ToString() method of these customers.

Attachment:- Assignment Files.rar

Reference no: EM131950101

Questions Cloud

Average total cost and the average variable cost : Assume that the cost curves have the usual shapes. Is the dollar difference between the average total cost and the average variable cost greater
Interest earned be equal to the original investment : If money is vested at 8% per year, after approximately how many years will the interest earned be equal to the original investment?
Research and discuss the basic theories of motivation : Research and discuss the basic theories of motivation as well as a description of what they are.
Company is considering two locations for new park : The Bells Fish and wildlife company is considering two locations for new park.
Develop console application to manage customers and accounts : SIT232 - OBJECT ORIENTED DEVELOPMENT PROJECT. You are required to develop a console application to manage customers and accounts using C#
Explain what benefits and pitfalls can occur : How an individual learns is essential to improving performance and effectiveness of the team and organization. Explain What benefits and pitfalls can occur?
Short run and medium run in macroeconomics : What is the difference between short run and medium run in macroeconomics.
What core beliefs do you think were being acted upon : Tell a story you've encountered on the job that really illustrates at least one of these aspects: What core beliefs do you think were being acted upon?
Consider zero-coupon bond with face value : Consider a zero-coupon bond with face value of $1,000 and 5 years to maturity. The bonds yield to maturity is 9%. What is its duration?

Reviews

len1950101

4/20/2018 1:46:16 AM

SUBMISSION INSTRUCTIONS - You need to zip your entire project and submit the zip file in the provided assignment folder by 5:00pm 29. Note that this is individual work, and thus you cannot share your solution with others.

len1950101

4/20/2018 1:46:10 AM

NOTE - Your program may generate different results depending on the date you run it. You could format the outputs of your program similarly to Figure 1. When a transaction/operation cannot be performed, e.g. withdrawing an amount that exceeds the balance, you could either write an error message (as shown in the 2nd line in Figure 1) or simply skip the transaction/operation.

len1950101

4/20/2018 1:46:02 AM

OTHERS - You are to determine appropriate modifiers (public, private, etc.), data types (e.g. string, int, double, etc.) for attributes and inputs/outputs for methods of your classes. Your implementation should reflect object-oriented principles such as abstraction, encapsulation, polymorphism. Make sure that you have sufficient comments to enhance the readability of your code, organise your program reasonably and make it maintainable conveniently (e.g. avoiding hard-code and repeating code, naming variables and methods meaningfully, using static, constants reasonably). Make your outputs in a reasonable and tidy format. You could refer to Figure 1 as an example. If your program cannot be compiled, the maximum score you could get is 50% of the total mark (i.e. 7.5%).

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd