Write a test program that creates an account object

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

The Account class

Design a class named Account that contains:

  • a private int data field named id for the account (default 0)
  • a private double data field named balance (default 0)
  • a private double data field named annualInterestRate (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
  • A constructor that creates an account with the specified id and balance
  • Accessor and mutator methods for id, balance and annualInterestRate
  • accessor method for dateCreated
  • a method called getMonthlyInterest() that returns the monthly interest (calculated as balance* monthlyInterestRate. monthlyInterestRate is annualInterestRate/12. annualInterestRate is a percentage like 4.5%)
  • a method called withdraw that withdraws a specified amount from the account
  • a method called deposit that deposits a specified amount to the account

Program: Write a test program that creates an Account object with an ID of 1122, a balance of 20000USD, and an annual interest rate of 4.5%.

Use the withdraw method to withdraw 2.500USD, use the deposit method to deposit 3000USD and print the balance, monthly interest and the date when the account was created.

Can you give the answer ASAP and there is no word limit?

Reference no: EM13693249

Questions Cloud

Compound operators or arithmetic assignment operators : Rewrite the given assignment statement using a combined assignment operator: (Use single spaces between operands and operators)
The empirical formula of the gasoline additive : The products of the combustion were 7.799 g of CO2(g) and 3.990 g of H2O(g). Insert subscripts below to appropriately display the empirical formula of the gasoline additive
Write a header for the pow function : Write a header for the pow function that returns a double and takes two parameters a double named base and an integer named exp.
What is the average atomic mass of br : Problem- Bromine has two isotopes of 78.918 u (50.69%) and 80.916 u (49.31%). What is the average atomic mass of Br
Write a test program that creates an account object : Write a test program that creates an Account object with an ID of 1122, a balance of 20000USD, and an annual interest rate of 4.5% - Use the withdraw method to withdraw 2.500USD, use the deposit method to deposit 3000USD and print the balance, mont..
Calculate the ph after the addition of 11.1ml of base : Part 1) How many milliliters of base are required to reach the equivalence point? Part 2) Calculate the pH after the addition of 11.1mL of base
What is the heat of reaction in kj : Assume the density of all the solutions is 1.0 g/mL, the specific heat of the aqueous solutions and mixture is the same as water, and the volumes are additive. What is the heat of reaction in kJ
Consider an isolated n-c bond in an organic compound : Problem- Consider an isolated N-C bond in an organic compound. Based on the electronegativities of the two elements, which of the following best describes the net charge on the carbon atom
Data set containing an unknown number of integers : The program should use I/O redirection to accept a file defined by the user which is a data set containing an unknown number of integers. The integers should be stored in an array, and printed to an output file - also defined by the user through r..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Initialize an array and fill the array with the gpa values.

Write a program in java that asks user input (using a loop) for name of 10 student and the corresponding grade point averages (GPAs). Initialize an array and fill the array with the GPA values.

  The factorial of a positive integer n, denoted by n!

Write a program that computes the sequence of factorial values: 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, ....

  Modify the program in 6a so that, in addition to the cents

Modify the program in 6a so that, in addition to the cents, the user enters the denomination of the coin to which to convert the pennies, such as 5 for nickles or 25 for quarters.

  Assume that section

Assume that section _1 seats are in front of the stage, and the price is expensive. say, each seat in the 1st three rows is $180.00, and each seat in the last two rows is 10% less;

  Program reads a number and prints all of its binary digit

Write a program that reads a number and prints all of its binary digits. Print the remainder number % 2, thenreplace the number with number / 2. Keep going until the number is 0.

  The rpn calculator program

The RPN calculator program should read the RPN expression as an entire line from stdin.Input will consist of a single line. After completing the evaluation of the expression, the program should print the contents of the entire stack, starting with th..

  Write a c program that converts celsius temperatures to

write a c program that converts celsius temperatures to fahrenheit temperatures.the formula isf95c 32.f is fahrenheit

  Prompts the user to enter the mass of a person

Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds. Output both the mass and the weight rounded to two decimal places

  Exponent and significant of a floating point

Write a program that requires the number of bits for the exponent and significant of a Floating Point representation; then requires two decimal real numbers and an operation either sum, subtraction or multiplication.

  How many integer values are in the array

Write a function named "location_of_largest" that takes as its arguments the following.

  Unlike c other programming languages have associative

unlike c other programming languages have associative arrays that allow array indices to be strings instead of just

  Train traveling in terms of minutes

Write a code for the following C++ problem. We will have a user that will be asked to input the time of a train traveling in terms of minutes and these minutes is a non-negative integer.

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