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

  Creates a file called "grades.txt" with 1000 lines

Write a program that creates a file called "grades.txt" with 1000 lines. Each line in the "grades.txt" file will consist of a student's first name, last name, graduating year(2013,2014,2015), and grade. the student's first name and last name for t..

  Use data structures and algorithm to implement search engine

For the URLs in the keyword list, sort them by either the number of times the keyword appearing in the pages or the popularity of the pages.

  Design a class that can be used to hold information

Implement and design a class that can be used to hold information about a musical note - Prepare a complete java program the default constructor should set a note to a middle C quarter note.

  Design a small wbis using elements from the disciplines

Design a small WBIS using elements from the disciplines of web design, database design, software engineering and object modelling;be able to develop a small WBIS using HTML forms, Java Servlets and cookies.

  Implement an iterative method with a for loop

Different scientists have developed Predator-Prey models to try to understand the interactions and foresee the evolution of the populations.

  Java program to compute invoice for client

You need a java program to compute the invoice for client and then print out invoice to the screen. The consulting rate is $200 per hour.

  Gui and multithreading

If you need help with completing discussions please click here for more information. Describe one (1) way in which a GUI can take advantage of multiple threads. Provide one (1) example of such advantages to support your response

  Write java program which simulates flipping of coin

Write a Java program which simulates flipping of coin 1000 times and prints total number of heads and tails. You should create a class.

  Write an interrupt service routine to output brand name

Evaluate the form of the output depended on the coefficients being input - Consider you would like to use PSoC to display a different brand name on the LCD once every 15 s.

  Portable file system implement a portable file system with

implement a portable file system with java language. i do have some requirements.implement a portable file system pfs.

  Write a java application using netbeans ide

Write a Java application using NetBeans Integrated Development Environment (IDE) or jGROUP IDE that calculates the total annual compensation of a salesperson

  Videorental store operatorrecord clients

Project is to design a program to help a videorental store operatorrecord clients' transactions - Design a primitive database indicating

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