Create an array to hold four account objects

Assignment Help JAVA Programming
Reference no: EM13809571

Program 1:

1. Add an instance method called transferTo to the Account class we discussed-

a. The transferTo method should transfer a specified amount of money to another bank account if there is enough balance. In this case, a successful tranerring message is returned. Otherwise (i.e., no enough balance), the transferring request should be denied and return a warning message to the caller.

b. Hence the method should accept two parameters: the destination bank account and the amount for transfer.

c. The transferTo method should return a stringback to the caller: "Transferred Successfully: $amount!" or "Transferred failure: no enough balance!".

2. Write Mybank class in Mybank.java

a. Create an array to hold four Account objects

b. For each account, randomly set the balance in the range of $0-$1000.00; print out the balance of each account

c. Transfer a random amount in the range of ($0-$100.00) from the 1st account to 2nd account; printout transferring results and their remaining balance.

d. Transfer a random amount in the range of ($0-$300.00) from the 3rd account to 4th account; printout transferring results and their remaining balance.

Program 2:

Write a program called Print2DArray.java which will ask the user to enter the number of rows and the number of column for a 2-dimention array. Then the program generates an integer number in the range of [0, 10000] for each element of the array.

1. Print the header including your name and panther ID; print a blank line after the header;

2. Print the 2-dimention array and each column is center-aligned;

3. Print out a blank line followed by the maximum, average and minimum values of the 2-dimention array.

Reference no: EM13809571

Questions Cloud

What must the expected return on this stock be : A stock has a beta of 1.25, the expected return on the market is 12 percent, and the risk-free rate is 2 percent. What must the expected return on this stock be?
Compare the movie duck and cover to the threat of terrorism : Write a 300- to 350-word paper in which you consider what it would have been like to live under the threat of nuclear war. Compare the movie "Duck and Cover" to the threat of terrorism. What are the similarities?
Calculate depreciation for each year-after-tax salvage value : Geary Machine Shop is considering a four-year project to improve its production efficiency. Buying a new machine press for $681,600 is estimated to result in $227,200 in annual pretax cost savings. Calculate the depreciation for each year and use to ..
Theories of poverty discussion : Theories of Poverty Discussion
Create an array to hold four account objects : Write Mybank class in Mybank.java. Create an array to hold four Account objects. For each account, randomly set the balance in the range of $0-$1000.00; print out the balance of each account
Calculate all other cash flows except : Alson needs someone to supply it with 120,000 cartons of machine screws per year to support its manufacturing needs over the next 7 years, and you've decided to bid on the contract. Calculate all other cash flows except the OCF related to the contrac..
Identify each type of energy source : Identify each type of energy source and its relative abundance and environmental impact.
Sharing information across groups : The planning for the community building session is almost complete. The last details are how to conduct the plenary sessions for sharing information across groups to develop key priorities and themes that will need to be addressed.
Write a summary of the video four women of egypt : Write a summary of the video "Four Women of Egypt".

Reviews

Write a Review

JAVA Programming Questions & Answers

  Constructing a simple flowchart that describes simple logic

Constructing a simple flowchart that describes simple logic flow through a program. Translating the flowchart into pseudo code. Creating a simple module, based on the pseudo code created in step 2, which accepts a parameter and returns a value.

  Exception handling

Write a java program to Facilitates keyboard input by abstracting details about input parsing, conversions, and exception handling.

  Create an array of five employee objects

Create an array of five Employee objects. Prompt the user to enter data for each Employee. Do not allow duplicate ID numbers to be entered.

  Write a script that reads a four-digit integer

Write a script that reads a four-digit integer entered by the user in a prompt dialog and encrypt it as follows: Replace each digit by (the sum of that digit plus 7) modulus 10.

  Automated code coverage and cyclomatic complexity analyses

Automated code coverage and cyclomatic complexity analyses -

  Socket programming in java: tcp

In this project we will develop a Web server in two steps. In the end, you will have built a multi-threaded Web server that is capable of processing multiple simultaneous service requests in parallel.

  Write a class called misc that has no instance variables

Write a static double method called evaluateQuadraticPolynomial that takes four double parametersa, b, c, and x and returns the value of ax^2 + bx + c

  Determines if the input string is a valid lock combination

Write a Java program that satisfies the given requirement - Prompts the user to input exactly nine characters, which constitute a valid lock combination.

  Type i and type ii virtualizations

Compare and contrast at least two (2) similarities and two (2) differences between Type I and Type II virtualizations. Using your comparison, choose either a Type I or Type II virtualization and determine a specific networking scenario in which yo..

  Create a class named blooddata that includes fields

Create a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh factor (the factors are + and -). Create a default constructor that sets the fields to "O" and "+", and an overloaded c..

  A uml activity diagram that illustrates how program works

Create a UML activity diagram that illustrates how your program works. Your diagram must include all the data items in your program.

  Prevent clear communication

Conversational implicature always prevents clear communication - Describe a situation where communication between you and a co-worker

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