473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

help with program writing...

GM
Hello. I am starting my 7th week of an intro to programming class and have
a problem I have been working on. My instructor said we could look for
source code on the internet and use it as long as we tailor it to fit the
problem at hand. I have not been able to attack this one with any kind of
success! Does anybody know of a URL that I can get a similar source code
for the following problem? Any help would be GREATLY appreciated. Thanks.

Create class SavingsAccount. Use static variable annualInterestRate to
store the annual interst rate for all account holders. Each object of the
class contains a "private" instance variable savingsBalance indicating the
amount the saver currently has on deposit. Provide method
calculateMonthlyInterest to calculate the monthly interest by multiplying
the savingsBalance by annualInterstRate divided by 12; this interest should
be added to savingsBalance. Provide a static method modifyInterstRate that
sets the annualInterstRate to a new value. Write a program to test class
SavingsAccount. Instantiate two savingsAccount objects, saver1 and saver2,
with balances of $2000.00 and $3000.00, respectively. Set annualInterstRate
to 4%, then calculate the monthly interest and print the new balances for
both savers. Then set the annualInterestRate to 5%, calculate the next
month's interest, and print the new balances for both savers.

--GM
Jul 17 '05 #1
1 3093
"GM" <ab******@cox.net> wrote in message
news:olp3c.61494$Bz3.60251@okepread05...
Hello. I am starting my 7th week of an intro to programming class and have a problem I have been working on. My instructor said we could look for
source code on the internet and use it as long as we tailor it to fit the
problem at hand. I have not been able to attack this one with any kind of
success! Does anybody know of a URL that I can get a similar source code
for the following problem? Any help would be GREATLY appreciated. Thanks.
Create class SavingsAccount. Use static variable annualInterestRate to
store the annual interst rate for all account holders. Each object of the
class contains a "private" instance variable savingsBalance indicating the
amount the saver currently has on deposit. Provide method
calculateMonthlyInterest to calculate the monthly interest by multiplying
the savingsBalance by annualInterstRate divided by 12; this interest should be added to savingsBalance. Provide a static method modifyInterstRate that sets the annualInterstRate to a new value. Write a program to test class
SavingsAccount. Instantiate two savingsAccount objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set annualInterstRate to 4%, then calculate the monthly interest and print the new balances for
both savers. Then set the annualInterestRate to 5%, calculate the next
month's interest, and print the new balances for both savers.

--GM

I know of no such resource, but my advice would be to stop wasting time
looking for it and spend that time instead learning how to program. This is
a simple exercise, and you'll learn a lot from doing it on your own. Also,
please post to comp.lang.java.help in the future instead of here. Not all
news servers carry this group. Finally, if you make an attempt at writing
this program and get stuck along the way, you'll find the people in c.l.j.h
more than willing to point you in the right direction. Good luck.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: PHPkemon | last post by:
Hi there, A few weeks ago I made a post and got an answer which seemed very logical. Here's part of the post: PHPkemon wrote: > I think I've figured out how to do the main things like...
10
by: atlanta | last post by:
this is a simple C++ program to write. "Write a complete and functioning structured program that successfully compiles on Visual C++ 6, that uses two-dimensional array (5x5) that stores...
27
by: SK | last post by:
Hi I am trying to teach myself how to program in C. I am a physician hoping to be able to help restructure my office. Anyhow, I amhoping that the porblem I am having is simple to those much more...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
12
by: asif929 | last post by:
I am trying to write a program which creates four triangles. The program begins with prompting a user " Enter the size of triangles", number from 1 to N is the size of four triangles For Example if...
15
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to...
12
by: adamurbas | last post by:
ya so im pretty much a newb to this whole python thing... its pretty cool but i just started today and im already having trouble. i started to use a tutorial that i found somewhere and i followed...
1
by: siva041986 | last post by:
Hi there, This is Siva. I need some help in writing a program for Unix. I need to write a program using Semaphores and avoid deadlocks and starvation. If you think you can help me please let me...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.