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

  Write a program that simulate n rolls of six-sided die

Write a program that simulate n rolls of six-sided die and displays the frequency of occurrence of each side and What is the most likely method signature of the "parseInt() - TNE60003

  Design a program that asks the user to enter a series of 20

Number Analysis Program: Design a program that asks the user to enter a series of 20 numbers

  Write program using a switch statement that display polygon

Write a program using a switch statement that displays the name of a polygon with sides between 3 and 12 depending on the number entered by the user

  Define get and set functions and two constructors

Create a class called Building. It will have one data member of type string (used for a postal address). Define get and set functions and two constructors.

  Discuss the legal ramifications of the division of condo

Discuss the legal ramifications of the division of condo, BioTech and other assets. Would it make any difference if Violet sold the property after filing for the dissolution of marriage?

  Write a program to track hourly employee arrival departure

THE JAVA SOURCE CODEWILL AWARD AN ADDITIONAL 1,500 POINTS TO PERSON WITH THE BEST ANSWER (you will be directed to another one of my previous, unanswered questions.)A company hires you to write a program to track hourly employee arrival and departure ..

  User enters a list of car parts

So if the user enters a list of car parts, the programm holds this list. Afterward, when the user types in the name of the part the programm outputs that name from the list.

  Write a program in java that reads contents of two vectors

Write a program in Java that reads contents of two vectors, and then displays the sum of these two vectors. The program should prompt the user to enter the size of the vectors first.

  Prepare a java simulation program

Given a hash function h, prepare a java simulation program to determine each of the subsequent quantities after 0.8*tablesize random keys have been generated. The keys should be random integers.

  Java code using jframe

Write a Java code using JFrame. This code needs to manipulate 4 shapes(2 rectangles and 2 squares) in a 400x400 JFrame. This needs to manipulate the shapes in 3 different ways, using 3 different methods. One for translating a shape, one for proportio..

  Create online store web site

the Java and JSP source codes and SQL scripts for creating a database in Oracle - any configuration files used

  Compute the fifties and the remaining amount

Prompt the user for a string input value for the amount in dollars and store it in a variable named input and convert the string to an integer and store it in the variable named amount.

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