943,562 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1654
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 10th, 2008
-1

Desperate for help!

Expand Post »
This class is moving too fast and I only know simple Java programming so far, but we're getting into multiple classes for this savings account program. If anyone can do this I will spam +rep on your for the remainder of your DaniWeb life.

---Data
• the identity number for the account (the identity number is never changed once the account has been constructed)
• the balance in the account (the balance can change as a result of some operations)
---Operations
• create an account with a given identity number and initial balance
• return the identity number
• deposit some positive amount into the account, increasing the balance
• decrease the balance by a specified positive amount; if the amount is greater than the balance throw an IllegalArgumentException
• return the monthly interest due

The Account class needs the things below.

public abstract class Account
{
private int idNumber; / identity number for this account
private double balance; / current balance for this account
private double yearlyInterest; /amount of interest per year for this account

/ precondition: startBal >= 0.0
/ postcondition: An account with identity number idNum and current balance of startBal has been created
public Account (int idNum, double startBal)

/ postcondition: returns the identity number for this account
public int idNumber ( )

/ postcondition: returns the current balance for this account
public double currentBalance ( )

/ precondition: amount >= 0.0
/ postcondition: the current balance of this account has been increased by amount
public void deposit (double amount)

/ precondition: 0.0 <= amount <= balance
/ postcondition: the current balance of this account has been decreased by amount
public void decreaseBalance (double amount)

/ postcondition: returns the monthly interest due for this account
public double monthyInterest ( )

}

The operations for SavingsAccount that differ from those specified in the class Account are the following:
• create a new savings account with a given annual interest rate, as well as the parameters required for all accounts
• withdraw a positive amount that does not exceed the current balance, decreasing the balance by the amount withdrawn
• calculate the monthly interest by multiplying the current balance by the annual interest rate divided by twelve

The operations for CheckingAccount that differ from those specified in the class Account that was described on day 2 are the following.
• create a new checking account with a given per-check charge, as well as the parameters required for all accounts
• clear a check for a given amount by decreasing the balance by the amount of the check plus the per-check charge
• compute and return the monthly interest

The operations for SpecialCheckingAccount that differ from those specified in the class CheckingAccount are the following.
• create a new special checking account with a given minimum balance and interest rate, as well as the parameters required for a checking account
• clear a check for a given amount according to the rules above
• calculate the monthly interest by multiplying current balance by the annual interest rate divided by twelve if the current balance is above the minimum; otherwise, calculate the interest as it is done for a checking account

I do have some code but it really only completes the simple task of creating the Account and giving the user their ID number. Other than that, that's pretty much the long and short of it guys. I'd really appreciate any >HELPFUL< comments or code and not flame for my request.

-IMtheBESTatJAVA
Similar Threads
Reputation Points: -1
Solved Threads: 0
Light Poster
IMtheBESTatJAVA is offline Offline
36 posts
since Oct 2008
Nov 10th, 2008
0

Re: Desperate for help!

This class is moving too fast and I only know simple Java programming so far, but we're getting into multiple classes for this savings account program. If anyone can do this I will spam +rep on your for the remainder of your DaniWeb life.
Well, I can do it, so start spamming, I just won't.

I guess your moniker is kinda like calling a 7 foot tall man "tiny", huh? (Only more so.)
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Nov 10th, 2008
0

Re: Desperate for help!

if we do it, that will only get you as far as your next assignment, its the ol teach a man to fish saying

i know you have quite a list of instructions, so break them down, focus on one account at a time, look at how it will be implemented and how you can using the functionality of your base class for it
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Nov 10th, 2008
0

Re: Desperate for help!

> If anyone can do this I will spam +rep on your for the remainder of your DaniWeb life

Pity, you haven't got any left.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006
Nov 13th, 2008
0

Re: Desperate for help!

Lol, you guys are so snarky and unhelpful.


I do know how to program, but its just that the class moves too fast. I could do this assignment, yet

I'm falling behind because it takes me too long to figure out how to fix all of my errors. And it would

take even longer if I brought them here to all of you snarky adults thinking you're so special that you

can't help me out. I didn't even necessarily ask you to do the entire thing, but maybe give me

something to start with... or hell, even teach me how to do it. Some people can learn by being given

a program you know. It's not like I'll look at what code you gave me and just say "Sweet! Time to

turn this all in and ask them to do the next one!" No. The learning environment that I have been

given is quite deplorable to say the least, and my friends and I have pretty much been making group

work of it, taking a little bit of what each of us know and putting it together, but I want the entirety of

it. Thanks for nothing but dissapointment I guess. Not even any kind of flow chart or synthesis on

what I have to do.

***
And my name was just a joke, its obvious sarcasm that I think you would all be light-hearted enough

to catch on to. As far as the reputation comment goes, that was false as well as you guys really

shouldn't care about rep as much as you do helping a fellow community member, especially a new

one such as myself.
Last edited by IMtheBESTatJAVA; Nov 13th, 2008 at 9:00 am.
Reputation Points: -1
Solved Threads: 0
Light Poster
IMtheBESTatJAVA is offline Offline
36 posts
since Oct 2008
Nov 13th, 2008
0

Re: Desperate for help!

well.. you don't have to show us your code and errors, if you think i!t's redundant, but how can we fix 'm if we don't know what to fix? ever thought about that, genious?
Reputation Points: 919
Solved Threads: 353
Nearly a Posting Maven
stultuske is offline Offline
2,471 posts
since Jan 2007
Nov 13th, 2008
0

Re: Desperate for help!

I think you are contradicting yourself:
I didn't even necessarily ask you to do the entire thing
Quote originally posted by IMtheBESTatJAVA ...
If anyone can do this I will spam +rep on your for the remainder of your DaniWeb life



Quote originally posted by IMtheBESTatJAVA ...
it takes me too long to figure out how to fix all of my errors. And it would take even longer if I brought them here
Why would it take even longer to fix your errors if you brought them here? Everybody else does. We don't know what you have done so far and what approach you have selected. With the information you gave us we would have to write the thing from the begining.

As a suggestion create different classes for each of the accounts and One different class for creating them and using them
Sponsor
Featured Poster
Reputation Points: 1014
Solved Threads: 446
Nearly a Senior Poster
javaAddict is offline Offline
3,258 posts
since Dec 2007
Nov 13th, 2008
0

Re: Desperate for help!

Here's a bit to get you started.

SavingsAccount should extend Account
CheckingAccount should extend Account
SpecialCheckingAccount should extent CheckingAccount

implement Account first, then override the methods in Account in the other three when you need different things to happen.
Reputation Points: 37
Solved Threads: 5
Light Poster
brianlevine is offline Offline
36 posts
since Oct 2008
Nov 13th, 2008
0

Re: Desperate for help!

If your "falling behind", as you say, if we did this for you, you would only fall faster, since you wouldn't learn anything, so tomorrow, when you get a new assignment that is, essentially, an expansion on this one, you will have no idea how to do the expansion, since you didn't either do, or learn, this one.

So, tell me again, how this would help you.
Last edited by masijade; Nov 13th, 2008 at 1:27 pm.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Nov 13th, 2008
0

Re: Desperate for help!

lol but he will fall later rather than sooner
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: hw to create a log file
Next Thread in Java Forum Timeline: Homework help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC