TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
johnwires
NA
1
0
Constructors- Passing in values in and setting it up?
Feb 27 2005 6:34 AM
Hi guys, Im working on savings account program that the user inputs a interest rate and a balance. 1.)How would i set the initial interest rate and balance values zero? 2.)Would anyone know how to take the interest rate and balance values from the client class to my driver constructor class so i can modify them? I know you do something like : balance = balance_box.Text or something like that... right now i have this as my driver constructor class: using System; namespace project { ///
/// Summary description for SavingsAccount. ///
public class SavingsAccount { //creating private variables private double annualInterestRate, savingsAccountBalance; //defualt constructor setting values to zero public SavingsAccount() { SetAnnualInterestRate( 0 ); SetSavingsAccountBalance( 0 ); } //methods to set values to zero, but i did that above, or do i need these? public SavingsAccount(double annualInterestRate ) { SetAnnualInterestRate(0); } public SavingsAccount(double savingsAccountBalance ) { SetSavingsAccountBalance(0); } } }
Reply
Answers (
1
)
Using Reflection methods in VB to find design-time Property values
Reflection