473,612 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 annualInterestR ate 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
calculateMonthl yInterest to calculate the monthly interest by multiplying
the savingsBalance by annualInterstRa te divided by 12; this interest should
be added to savingsBalance. Provide a static method modifyInterstRa te that
sets the annualInterstRa te 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 annualInterstRa te
to 4%, then calculate the monthly interest and print the new balances for
both savers. Then set the annualInterestR ate to 5%, calculate the next
month's interest, and print the new balances for both savers.

--GM
Jul 17 '05 #1
1 3102
"GM" <ab******@cox.n et> wrote in message
news:olp3c.6149 4$Bz3.60251@oke pread05...
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 annualInterestR ate 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
calculateMonthl yInterest to calculate the monthly interest by multiplying
the savingsBalance by annualInterstRa te divided by 12; this interest should be added to savingsBalance. Provide a static method modifyInterstRa te that sets the annualInterstRa te 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 annualInterstRa te to 4%, then calculate the monthly interest and print the new balances for
both savers. Then set the annualInterestR ate 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
2747
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 storing products in
10
2088
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 numbers. Read in the numbers, print them forward and backward." i dont know How to write C++.
27
2087
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 experienced in programming. I am trying to use the concept of arrays to calculate the hours of my backoffice staff, however I am getting a ridiculous amount of error lines. If any one has time to help me that would be great. I am using the...
1
3703
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 attach this script files and inq files. I cant understand this error. Please suggest me. You can talk with my yahoo id b_sahoo1@yahoo.com. Now i am online. Plz....Plz..Plz...
12
2802
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 we enter 4, the size of four triangles are 4 rows. In addition, I am also writing a program which i started and failed in giving the right size of traingles. I will appreciate if somebody can help.
15
2569
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 determine who needs to receive the text message then send the message to the address. Only problem is, the employee may receive up to 4 of the same messages because each thread gets the recors then sends the message. I need somehow to prevent...
12
2997
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 the instructions and couldnt get the correct results. heres the code stuff... temperature=input("what is the temperature of the spam?") if temperature>50: print "the salad is properly cooked." else:
1
1499
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 know. I really need your help badly. I will send you complete details of the program if you are ready to help me. Please let me know if you know Unix and its programming. Looking forward for ur reply. Thanks and regards, Siva.
5
3295
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? Why do I need to set a property within my code to the service name? Are all these required or am I just doing this for consistency purposes?
0
8615
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8568
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5536
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4110
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2554
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1699
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.