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

  Write a java program

Create a "JApplet" that contains two parallel arrays with at least five friends' names and phone numbers. Allow the user to enter either a name or phone number and to click a "JButton" to display the other.

  Create a method that would search through an arraylist

What is the best way of the following ways (For each, Iterator, While with index) that you would use to create a method that would search through an ArrayList of files for a certain file and then delete it, and why?

  Exception handling

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

  1 securityimplement security so that all users can view the

1. security.implement security so that all users can view the information about the projects but only authenticated

  Class named person with fields for holding a person''s name

Design a class named Person with fields for holding a person's name, address, and telephone number. Write one or more constructors and the appropriate mutator and accessor methods for the class's fields.

  Write java program that writes names to text file

Create an empty text file called myfile.txt. Write a Java program that writes your names to the text file created. If the file does not exist, include an exception handler for that error.

  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.

  Write a program cmsc401 java

Write a program cmsc401.java that receives a sequence of commands (from 1 up to 10000 commands)

  Create a road class

Create a Road class. The class should have functions for setting the width of the road in feet and the length of the road in miles. It should also have functions for obtaining the width of the road the length of the road.

  Your task for this project is to design a program to help a

your task for this project is to design a program to help a videorental store operatorrecord clients transactions.nbsp

  Output the number of vowels

Prompt the user to enter a string, and using a loop, count and output the number of vowels, and consonants the string contains. (You have to find methods from class.)

  Write java program to accept two words as input

Write a Java program that accepts two words as input and determines if one of them is resulting from changing the order of the others' letters.

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