Desperate for help!

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2008
Posts: 37
Reputation: IMtheBESTatJAVA has a little shameless behaviour in the past 
Solved Threads: 0
IMtheBESTatJAVA IMtheBESTatJAVA is offline Offline
Light Poster

Desperate for help!

 
-1
  #1
Nov 10th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,467
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 267
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Desperate for help!

 
0
  #2
Nov 10th, 2008
Originally Posted by IMtheBESTatJAVA View 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.
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.)
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,162
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 138
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Desperate for help!

 
0
  #3
Nov 10th, 2008
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
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,651
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Desperate for help!

 
0
  #4
Nov 10th, 2008
> 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.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 37
Reputation: IMtheBESTatJAVA has a little shameless behaviour in the past 
Solved Threads: 0
IMtheBESTatJAVA IMtheBESTatJAVA is offline Offline
Light Poster

Re: Desperate for help!

 
0
  #5
Nov 13th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 706
Reputation: stultuske is a jewel in the rough stultuske is a jewel in the rough stultuske is a jewel in the rough 
Solved Threads: 84
stultuske's Avatar
stultuske stultuske is offline Offline
Master Poster

Re: Desperate for help!

 
0
  #6
Nov 13th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 1,718
Reputation: javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all 
Solved Threads: 229
Featured Poster
javaAddict's Avatar
javaAddict javaAddict is offline Offline
Posting Virtuoso

Re: Desperate for help!

 
0
  #7
Nov 13th, 2008
I think you are contradicting yourself:
Originally Posted by IMtheBESTatJAVA View Post
I didn't even necessarily ask you to do the entire thing
Originally Posted by IMtheBESTatJAVA
If anyone can do this I will spam +rep on your for the remainder of your DaniWeb life



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
Check out my New Bike at my Public Profile at the "About Me" tab
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 34
Reputation: brianlevine is an unknown quantity at this point 
Solved Threads: 5
brianlevine brianlevine is offline Offline
Light Poster

Re: Desperate for help!

 
0
  #8
Nov 13th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,467
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 267
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Desperate for help!

 
0
  #9
Nov 13th, 2008
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.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,162
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 138
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Desperate for help!

 
0
  #10
Nov 13th, 2008
lol but he will fall later rather than sooner
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum


Views: 1068 | Replies: 10
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC