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

  C program to calculate power loss in transmission line

Write program in C to calculate the power loss in transmission line with resistance of 0.05 ohms/mile. Calculate power loss if 500 kW of power is transmitted from power generation station

  What is the output of the corrected loop

What is the output of the loop as it is written and correct the syntax of the loop so that the logic of the corrected loop corresponds to the formatting of the original loop. What is the output of the corrected loop?

  Generate two files of 100 by 100 mazes

Write a C++ program that opens a file representing an encoded maze and reads it

  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.

  Person class that includes fields for last name

Create a Person class that includes fields for last name, first name, and zip code. Include a default constructor that initializes last name, first name, and zip code to "X" if no arguments are supplied. Also include a display function. Write a ma..

  A palindrome is a number

A palindrome is a number or text phrase that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 34543 and 11611. Write a program that reads in a five-digit integer and determines ..

  Implementation of sorting technique

Implementation of sorting technique

  The user enter the total rainfall for each of 12 months

Write a program that lets the user enter the total rainfall for each of 12 months (starting with January) into an array of doubles. The program should calculate and display:the total rainfall for the year,the average monthly rainfall,and the months w..

  Write a program that first prompts the user

Write a program that first prompts the user (repeatedly , if necessary) to supply a single digit(0,1,2..9) The program should repeatedly prompt the user for integer values until a sentinel value of 0 is entered to terminate the program.

  How will you do the shrink operation

How will you do the shrink operation and how will you do the expand operation -

  One time for the entire number set

You must run your program one time for the entire number set. Test for EOF (or use the function feof()) to know when to stop processing. You are to determine if each integer read is prime or not, and output the result to stdout

  Program to produce ten random permutations of numbers

In C++(must be able to compile in Visual Studio ): Write a program to produce ten random permutations of numbers 1 to 10.

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