Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: My java teacher sucks I need help

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Thanked 0 Times in 0 Posts

    Angry My java teacher sucks I need help

    Hello I just started my first java class in college, well really my first programming class since High school true basic. But I made one mistake I'm doing it online and my teacher is no help at all actually he doesn't teach at all he just sends us slides along with a project, test and writing assessment. And now we are on chapter 7 multidimensional array. And we have to do two project and one of them is completely over my head and somewhat confusing to me so I'm asking for your help I'm sure some of you have seen this assessment before while taking intro to java. And I found what I thing to be the complete code of the assessment online but I don't just want to copy and paste it I actually want to know what's happening step by step so that I can understand the code.
    The assessment
    (Financial tsunami) Banks lend money to each other. In tough economic times, if a bank goes bankrupt, it may not be able to pay back the loan. A bank’s total assets are its current balance plus its loans to other banks. The diagram in Figure 1 shows five banks. The bank’s current balances are 25, 125, 175, 75, and 181 million dollars, respectively. The directed edge from node 1 to node 2 indicates that bank 1 lends 40 million dollars to bank 2.
    If a bank’s total assets are under a certain limit, the bank is unsafe. The money it borrowed cannot be returned to the lender, and the lender cannot count the loan in its total assets. Consequently, the lender may also be unsafe, if its total assets are under the limit. Write a program to find all unsafe banks. Your program reads the input as follows. It first reads two integers n and limit, where n indicates the number of banks and limit is the minimum total assets for keeping a bank safe. It then reads n lines that describe the information for n banks with IDs from 0 to n-1.
    The first number in the line is the bank’s balance, the second number indicates the number of banks that borrowed money from the bank, and the rest are pairs of two numbers. Each pair describes a borrower. The first number in the pair is the borrower’s ID and the second is the amount borrowed. For example, the input for the five banks in Figure 1 is as follows (note that the limit is 201):
    5 201
    25 2 1 100.5 4 320.5
    125 2 2 40 3 85
    175 2 0 125 3 75
    75 1 0 125
    181 1 2 125

    The total asset of bank 3 is (75 + 125), which is under 201, so bank 3 is unsafe. After bank 3 becomes unsafe, the total assets of bank 1 fall below (125 + 40). Thus, bank 1 is also unsafe. The output of the program should be
    Unsafe banks are 3 1
    (Hint: Use a two-dimensional array borrowers to represent loans. borrowers[i][j] indicates the loan that bank i loans to bank j. Once bank j becomes unsafe, borrows[i][j] should be set to 0.)
    Figure 1 – Banks lend money to each other
    100.5 85 75
    25 125
    320.5 125 40 75
    181 125 175

  2. #2
    Join Date
    Jun 2013
    So. Maryland, USA
    My Mood
    Thanked 899 Times in 879 Posts

    Default Re: My java teacher sucks I need help

    Welcome to the forum! Please read this topic to learn how to post code correctly and other useful info for new members.

    We can't do it for you. Please ask for specific help rather than general "explain this," or "help me get started." What don't you understand? Certainly you can create a class or two and get a start on the assignment. Come back after you've done that and have some code you need help with and specific questions.

  3. #3
    Administrator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,643 Times in 2,613 Posts

    Default Re: My java teacher sucks I need help

    Also posted at: My java teacher sucks I need help

Similar Threads

  1. Looking for a teacher for beginner Java programming
    By dazaga in forum Paid Java Projects
    Replies: 4
    Last Post: June 2nd, 2014, 04:42 PM
  2. Looking for A Java Teacher
    By BigBoi2010 in forum Object Oriented Programming
    Replies: 3
    Last Post: June 7th, 2012, 11:43 AM
  3. Question about object passing to a method? My VOCAB sucks
    By tripline in forum Object Oriented Programming
    Replies: 6
    Last Post: October 28th, 2011, 01:48 PM

Tags for this Thread