| Author |
Message |
|
|
If you need any help with the images, i would like to design the graphic part of the program, i'll leave the programming to destin, since he's a little better than me
|
 |
|
|
Well, im new to ArrayList and im having great trouble trying to figure things out,
this is what im supposed to do:
The Problem
A banking institution offers certificates of deposit (CD's) with a variety of interest rates, and maturities of 1, 3, 5, and 10 years. Interest is always compounded, daily, monthly, or quarterly.
Write a Java program that will compute the accumulated value (principal plus interest earned), at yearly intervals, of any number of such CD's. Assume that a year always consists of exactly 365 days.
Output will be a series of 10 annual reports:
Reports will be in table form with appropriate column headings. There will be one row of the table for each active CD, which will include all the data along with the accumulated value and total interest earned to data.
Each report will also print the total interest earned by all CDs for the current year, and total interest earned by all active CD’s to data.
Once a CD reaches maturity, it will stop earning interest and will not appear in any future reports. E.g., a CD with a maturity of 5 years will appear in the reports for years one through five, but not thereafter.
The CD Class
Begin by creating a class to model a CD. Each CD object "knows" its own principal, interest rate, maturity, and compounding mode (private instance variables). The class has “get” methods to return this data and a method to compute and return the accumulated value.
The CDList Class
Now create a class to maintain a list of CDs. You will need methods to add a CD to the list and to print the annual report.
The Driver (i.e., "Test") Class
Your test class or "driver" class will read data for any number of CDs from a file that I will supply. Each line of the file will contain the data – principal, interest rate (as an annual per cent), maturity, and compounding mode – for one CD.
First, tokenize each line read, create a CD object from the tokens, and add it to the list. Then print the reports.
Additional Specifications
Your CDList class must use an ArrayList as the principal (no pun intended) data structure.
Your test class is to read the data file one time only. No credit will be given for programs that read the data file more than once.
Make sure your program is well documented and adheres to the style conventions discussed in class.
Due date: Thursday, April 20th
Formula
The accumulated value (i.e., principal plus interest), A, is given by the formula:
r nt
A = p ( 1 + ———— )
n
where
p = principal
n = number of times compounded per year
r = annual interest rate, expressed as a decimal
t = elapsed time in years
now, im supposed to read data from a file, and whats inside the file is:
5000 5 8.25 quarterly
12000 10 10.80 daily
2000 5 7.30 quarterly
10000 3 5.55 monthly
2000 1 4.50 daily
5000 10 9.15 monthly
now, im totally lost, however, ive managed to do this so far:
Please any help regarding this subject will be greatly appreciated.
|
 |
|
|
|
Well, i want to know how to create a CD object, that will be the beggining
|
 |
|
|
Hi,
im new to arraylist, so im kind of lost here without a map.
would you guys help me out figure out the algorithm for this so i can try and do some coding.
thanks.
A banking institution offers certificates of deposit (CD's)
with a variety of interest rates, and maturities of 1, 3,
5, and 10 years. Interest is always compounded, daily,
monthly, or quarterly.
Write a Java program that will compute the accumulated
value (principal plus interest earned), at yearly
intervals, of any number of such CD's. Assume that a year
always consists of exactly 365 days.
Output will be a series of 10 annual reports:
1. Reports will be in table form with appropriate column
headings. There will be one row of the table for each
active CD, which will include all the data along with the
accumulated value and total interest earned to data.
2. Each report will also print the total interest earned by
all CDs for the current year, and total interest earned by
all active CD’s to data.
3. Once a CD reaches maturity, it will stop earning
interest and will not appear in any future reports. E.g., a
CD with a maturity of 5 years will appear in the reports
for years one through five, but not thereafter.
II. The CD Class
Begin by creating a class to model a CD. Each CD
object "knows" its own principal, interest rate, maturity,
and compounding mode (private instance variables). The
class has “get” methods to return this data and a method to
compute and return the accumulated value.
III. The CDList Class
Now create a class to maintain a list of CDs. You will need
methods to add a CD to the list and to print the annual
report.
IV. The Driver (i.e., "Test") Class
Your test class or "driver" class will read data for any
number of CDs from a file that I will supply. Each line of
the file will contain the data – principal, interest rate
(as an annual per cent), maturity, and compounding mode –
for one CD.
First, tokenize each line read, create a CD object from the
tokens, and add it to the list. Then print the reports.
V. Additional Specifications
1. Your CDList class must use an ArrayList as the principal
(no pun intended) data structure.
2. Your test class is to read the data file one time only.
No credit will be given for programs that read the data
file more than once.
3. Make sure your program is well documented and adheres to
the style conventions discussed in class.
FORMULA: A = p *( 1 +R/N)^N*T
the algorithm for this will help me a whole lot to see the
big picture, then maybe i can try to add the arraylists and
all the other functions,
thanks in advance.
|
 |
|
|
I have written a "dummy" code, because i need to understand a concept, then apply it to other programs. So, help me solve this dummy code, it is not homework.
what i need is:
1. how to use a boolean properly.
2. use the object num in the tester // i dont know why it doesnt work.
3. make a do-while in the tester, so it will ask "enter a number" until the user enters a number greater than 10. if the user enters less than 10 i want the program to loop the question until done right.
|
 |
|
|
well, i finally found a way to solve this. not like my teacher wants but what the heck.
|
 |
|
|
Ok, i've made a few changes here, but i still dont know how to make it so, if the user doesnt enter either 1 or 2 it will repeat the question. instead i get an error and it kicks me out of the program.
the code below has a boolean with a loop, however, it says it doesnt work with an Int
???
Btw, i want to know if the exit2 that's inside the boolean, it's going to work with, or if it's connected to the exit2 that's on my tester, or if it needs to be linked, how it's that done?
I need this so everytime it asks yes or no, it will repeat the loops until entered correctly.
PLEASE HELP ME!!
|
 |
|
|
stdunbar wrote:We don't have your current code for Game - can you post it too?
i've placed the:
if(numMarbles == 1)
{
System.out.println("you lose");
}
the problem is, i dont know where to put it, and i dont know when to put the if when the PC hets one.
|
 |
|
|
Here is my problem, i need the program to say, either you lose or you win, when there is only one marble left.
because the game ends when there is only one marble left.
i've tried many times but i havent got it to work.
|
 |
|
|
i got this:
and i want this to work using data from the getRandomNum()
how do i access marbleNum from ComputerPLay() ??
|
 |
|
|
Hello,
this is the problem:
Write a program in which the computer
plays against a human opponent. Allow
the human to choose whether to go first
or second. Generate a random integer
between 10 and 100 inclusive to determine
the initial size of the pile. After each turn,
print out the player name (human’s name or computer),
how many marbles were taken, and the
number of marbles remaining. The number
of marbles removed by the computer on
each turn is a random int between 1 and n/2
(where n is the number of marbles remaining).
When each game ends, the user is asked whether
she wants to play again.
I've been trying for hours and hours, so i finally decided it was time to ask for help.
this is what i've came up with, the code isn't running, but maybe you can see what im trying to do.
I must say i've googled the problem and search many websites about java, so please save your links, i have them all, the problem i have is that i have the tools but i need some one to show me how to use them.
Thanks for the support.
|
 |
|
|
unknownterra wrote:
GeeksUnite wrote:
Oh, gee, I just noticed: It's Friday! I sure hope the sexy girl isn't late for her assignment!
Thanks, now she's really gone now, and i had my hopes up......btw, on fridays, hot chicks are partying all day unlike some nerds *cough*yawmark*cough*
I wonder if she's using that name for a reason?
*unknownterra wonders if the sexy girl is a Nintendo fanatic*
or shes probably 64 years old, which is probably the case.....now yawmark, i'll let you have her thats how good of a person i am.
|
 |
|
|
well as u can see here:
im missing the playerNumber from here:
so the solution was to create a system.out.print() then int playerNumber = scanner.nextInt();
|
 |
|
|
Nevermind i solved it
|
 |
|
|
this is my main class' code:
and this is the test class code:
i get the following error in my test class:
MarbleGametester.java:16: cannot find symbol
symbol : variable playerNumber
location: class MarbleGametester
MarbleGame spaceboy = new MarbleGame(choice, name, playerNumber);
1 error
Process completed.
thanks in advance
|
 |
|
|
|
|