Use random function to create account number

Assignment Help JAVA Programming
Reference no: EM13312347

BANK ACCOUNT

Part A:

Create file Account.java. File Account.java contains a class representing a bank account similar (Note that the constructor generates the account number randomly.) Save this file to your directory and use it in Part B. Class Account allows deposit, withdraw, and inquire. This class contains:

• Constructor: initialize account information (ex. A/C name and A/C number) and account balance.
• Withdraw method: deducts amount from current balance.
• Deposit method: adds amount to current balance.
• Inquiry method: returns current balance.
• ToString method: returns account information in a nice string. Example: Name: "Account Name" Balance: "Account Balance" Account Number: "Account Number."
• Number of Account method: returns the total number of accounts.

Requirement:

a. Use Random function to create account number. Random Function: Math.random().
b. Withdraw method -- Deducting amount from balance, if balance doesn't cover withdrawal, prints message "insufficient funds" and does not change the balance.
c. Suppose the bank wants to keep track of how many accounts exist.

Declare a private static integer variable numAccounts to hold this value. It will automatically be initialized to 0.

o Add code to the constructor to increment this variable every time an account is created.
o Add a static method numAccounts that returns the total number of accounts. (Think about why this method should be static -- its information is not related to any particular account.)

Part B:

Create file AccountTest.java to test Account.java follow on the following requirements:

a. Create a new account from Account.java. The account name is " Mike" and initial balance is 500.
b. Get Account information.
c. Deposit an amount of 500 to Mike account and inquire new balance.
d. Create a new account from Account.java. The account name is " Susan" and initial balance is 100.
e. Withdraw an amount of 50 from Susan account and inquire new balance.
f. Withdraw another amount of 70 from Susan account. (You should get message insufficient funds at this point.)
g. Returns the total number of accounts.

VERY IMPORTANT DOCUMENTATION THAT IS NECCESARY!!!

• Documentation of the project, containing the algorithm, produced in pseudocode or flowchart, as well as the UML diagram representing the class structure of the program.

• Detailed instructions on how to use the program and its intricacies. 

Reference no: EM13312347

Questions Cloud

Determine the forces fx and fy necessary to hold the pipe : Water flows steadily through a horizontal 30 degree upward bend. The inlet diameter is 0.3 m, the velocity is 12 m/s, and the pressure is 128 kpa gage. The outlet diameter is 0.38 m and the pressure is 145 kpa gage.
Explain what is the equilibrium concentration of h3o : Consider the following reaction: HC2H3O2 (aq) + H2O (l) = H3O+ (aq) + C2H3O2- (aq) Kc=1.8*10^-5 If a solution initially contains 0.260M HC2H3O2, what is the equilibrium concentration of H3O+ at 25C
Determine the optimal amount of space rays and zappers : Galaxy Industries is a manufacturing company that produces two toy doll models: the Space Ray and the Zapper. The Space Ray can be sold for a profit of $8/dozen and a profit of $5 can be made if a dozen of Zappers are sold.
Calculate the height to whcih the ball rises above the cliff : A 0.17kg ball is thrown vertically upwards with a velocity of 34m/s at the edge of a 22m cliff. Neglect air resistance. calculate The height to whcih the ball rises above the cliff
Use random function to create account number : Add a static method numAccounts that returns the total number of accounts. (Think about why this method should be static -- its information is not related to any particular account.)
Explain the use extraction or recrystallization : In the purification of a mixture, what determines whether you use extraction or recrystallization as the initial procedure
Determine the external wind pressure acting on the windward : A closed storage building is located on open flat terrain in central ohio. If the side wall of the building is 20ft high, determine the external wind pressure acting on the windward and leeward walls. Each wall is 60ft long.
Create the look for two gui applications : Create the look for two GUI applications. You WILL NOT be getting the applications to do anything. We are only interested in seeing how well you can arrange the GUI components onto the window
How do the two sets of values compare : The graph of two cars that collide shows that they intersect at a point 5.5m on a distance/time graph. The first car has a velocity of 0.39m/s. How do the two sets of values compare

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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