473,324 Members | 2,196 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,324 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 3091
"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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.