Create a class called savingsaccount

Assignment Help DOT NET Programming
Reference no: EM131870386

PROGRAMMING ASSIGNMENT

INSTRUCTIONS

Adapted from: Deitel&Deitel (2017). Visual C# 2015 How to Program (6th ed.). Pearson Education, Inc.

Create a class called SavingsAccount. Use a static variable called annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance, indicating the amount the saver currently has on deposit. Provide method CalculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12 - this interest should be added to savingsBalance. Provide static method setAnnualInterestRateto set the annualInterestRate to a new value. Write an application to test class SavingsAccount. Create three savingsAccount objects, saver1, saver2, and saver3 with balances of $2,000.00, $3,000.00, and 0.00, respectively. Set annualInterestRate to 4%, then calculate the monthly interest and display the new balances for both savers. Then set the annualInterestRate to 5%, calculate the next month's interest and display the new balances for both savers.

Technical Requirements:

Create SavingsAccount class with static variable annualInterestRate and private instance variablessavingsBalance (double) and savingsAccountName (string).

Create a mutator method to set the savingsAccountName. Call this method setSavingsAccountName. The method should take a string argument and return void.

Create an accessor method to retrieve the savingsAccountName. Call this method getSavingsAccountName. The method should take no arguments and return a string (i.e. the savingsAccountName).

Create a mutator method to set the savingsBalance. Call this method setSavingsBalance. The method should take a double argument and return void.

Create an accessor method to retrieve the savingsBalance. Call this method getSavingsBalance. The method should take no arguments and return a double (i.e. the savingsBalance).

Include two constructors. The first takes no arguments and sets the savingsBalance variables to zero and sets the savingsAccountName to an empty string by calling the second (i.e. two argument) constructor with 0 and an empty string. The second constructor takes one double argument (the savingsBalance) and one string argument (the savingsAccountName), and sets the savingsBalance by calling the setSavingsBalance method and setsavingsAccountName method, respectively.

Create CalculateMonthlyInterest method with formula. The method should return void.

Create setAnnualInterestRatemethod to take a double argument representing the annualInterestRate and return void.

Create PrintSavingsAccount method to display the savingsBalance, savingsAccountName, and annualInterestRate for an object. Use the output shown below as a guideline for the display.

Create a separate class called SavingsAccountTest, which contains the Main() method.

In the Main() method, create three savingsAccount objects called saver1, saver2, and saver3. Initialize saver1 and saver2 with the balances listed above and the names "Saver_One" and "Saver_Two", respectively. Do not initialize saver3 with anything. Instead, create the object by invoking its zero-argument constructor, which will initialize its balance to 0 and its name to an empty string.

In the Main() method, call setAnnualInterestRate to set the interest rate to 4%.

Next, call the setSavingsAccountName for saver3 to set its name to "Saver_Three". Then, call the setSavingsAccountBalance for saver3 to set its balance to $50,000.

Print the results by calling PrintSavingsAccount for each object.

Next, call the CalculateAnnualInterestRate method for all three saver objects.

Print the results again by calling PrintSavingsAccount for each object.

Next, change the annualInterestRate to 5% by calling the setAnnualInterestRatemethod.

Print the results again by calling PrintSavingsAccount for each object.

Reference no: EM131870386

Questions Cloud

What leadership characteristics you want to possess : Define Leadership. Do library and/internet research plus use what you have learned in class to come up with this definition - what leadership characteristics
What dollar amount of supplies will be included in the fund : If the pricing objective of the fund is to be achieved, what dollar amount of supplies will be included in the Fund's cost of goods sold for the year
What are the potential problems with the approach : Employee referrals for organizational recruitment, paid or unpaid, can be an effective tool for recruitment. What are the potential problems with this approach.
Denote the total yield from all 9 fields : A farmer has 9 wheat fields planted. The distribution of yield from each field has a mean of 1000 bushels and variance 20,000. Further-more
Create a class called savingsaccount : Create a class called SavingsAccount. Use a static variable called annualInterestRate to store the annual interest rate for all account holders.
Compute the present value and future value : Compute the present value of an $1,600 payment made in 10 years when the discount rate is 12 percent.
Explain the accounting treatments for notes and bonds : Identify and explain what factors may cause change in market/fair value of fixed rate notes and bonds? Explain accounting treatments for notes and bonds
What is the probability that the proportion of heads : In tossing a fair coin 50 times, what is the probability that the proportion of heads will exceed .55?
Identify the design elements : mployee training and development 7th edition. Read the Case: Program Redesign Reduces Cost and Satisfies Learners

Reviews

Write a Review

DOT NET Programming Questions & Answers

  Develop web services based application

Develop and test a Web services based application that meets the requirements applying SOA design principles.

  Design style elements in asp

Add drop down lists for modifying the different style elements for the label element that displays the time

  Create a shopping cart in asp

The users will use a browser to access the on-line store. The web server software for the production web server is Windows 2003 Server /IIS6.

  Inventory management system in c# application

Inventory management system in c# application

  Using .net resources to teach .net

This project will use the .NET framework to produce a set of materials to demonstrate the fundamental principles of .NET. Ideally it should demonstrate some of the principles of the framework e.g. interoperability.

  Prepare a marymount faculty site

Prepare a Marymount faculty site

  Blinky lights

Analysis proving that your code blinks the LEDs at the specified rates.

  Prepare a web application

Prepare a web application that will be used to keep track of patients registering in a hospital.

  Implementing the insurance management system

Implementing the Insurance Management System and implementation of Components as Web Services.

  Describe the characteristics of visual studio 2005

Describe the characteristics of Visual Studio 2005 Visual Studio.Net is a suite of products that includes 4 main languages. Name these languages and outline their use in industries

  What is a connectionstring

What is a ConnectionString. Give a suitable example to illustrate the various part of a ConnectionString

  Prepare a web application for internet service provider

Prepare a Web application and write the code also event planning document base. This web application allows the user to sign up for an Internet service provider for home connectivity.

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