| | |
Desperate for help!
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2008
Posts: 37
Reputation:
Solved Threads: 0
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
---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
•
•
•
•
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.
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
----------------------------------------------
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
•
•
Join Date: Aug 2008
Posts: 1,162
Reputation:
Solved Threads: 138
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
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
www.houseshark.net
> 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.
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
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
•
•
Join Date: Oct 2008
Posts: 37
Reputation:
Solved Threads: 0
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.
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.
I think you are contradicting yourself:
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
•
•
•
•
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
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
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.
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
----------------------------------------------
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
•
•
Join Date: Aug 2008
Posts: 1,162
Reputation:
Solved Threads: 138
lol but he will fall later rather than sooner
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
![]() |
Similar Threads
- please help i am very desperate (Python)
- Desperate Darlene1 miight have to get a job. (Windows NT / 2000 / XP)
- desperate for password protection (PHP)
- Desperate for password protection (HTML and CSS)
- Please Read....Im desperate... (Troubleshooting Dead Machines)
- Desperate Call For Help!! (Windows NT / 2000 / XP)
- c++/unix fork(), fifo's, desperate need of help (C++)
- We'z goin' downhill ... (DaniWeb Community Feedback)
- Some Basic Code Hopefully (Help Needed) (HTML and CSS)
Other Threads in the Java Forum
- Previous Thread: hw to create a log file
- Next Thread: Homework help
Views: 1068 | Replies: 10
| Thread Tools | Search this Thread |
Tag cloud for Java
3d @param affinetransform android api apple applet application arc arguments array arrays automation binary bluetooth byte c# chat class classes click client code color compare component corrupted database detection draw eclipse error event exception file fractal game givemetehcodez graphics gui guitesting helpwithhomework html ide image input integer j2me java java.xls javaprojects jmf jni jpanel julia keytool linux list loop map method methods mobile netbeans newbie number object oracle pong print problem producer program programming project projectideas read recursion reflection replaysolutions rim scanner screen server set size sms socket sort sql string swing terminal test threads time transfer tree web windows






