473,405 Members | 2,176 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,405 software developers and data experts.

Declare a Class

1
Declare a class named Account, which has a private data member, a constructor, and three public function members. The data member is named balance and store the balance money in the account. The constructor has a default value as zero. The three public function members are ShowBalance function which will be return balance to the caller, WIthdraw function which will return the amount to be withdrew and update the balance if it can be withdrew(that is all accounts need to keep balance more or equal to zero), otherwise return 0, and Deposit function which will increase the value of balance.


i need to know how many function members beside constructor are there and name them
Nov 9 '06 #1
3 2196
Expand|Select|Wrap|Line Numbers
  1. class Account{
  2.    float balance;
  3. public:
  4.    Account(float balance=0);
  5.    float balance();
  6.    float withdraw(float withdrawal);
  7.    void deposit(float depositedAmount);
  8. };
  9.  
Nov 9 '06 #2
sicarie
4,677 Expert Mod 4TB
Declare a class named Account, which has a private data member, a constructor, and three public function members. The data member is named balance and store the balance money in the account. The constructor has a default value as zero. The three public function members are ShowBalance function which will be return balance to the caller, WIthdraw function which will return the amount to be withdrew and update the balance if it can be withdrew(that is all accounts need to keep balance more or equal to zero), otherwise return 0, and Deposit function which will increase the value of balance.


i need to know how many function members beside constructor are there and name them
Right....um, doesn't the total of described members in the first sentence answer your question? It looks like there are five, and they even go on to name them... I'm sorry, I don't think I'm understanding your question.
Nov 9 '06 #3
Forgot the destructor
Nov 9 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Irish | last post by:
Hello all :) Hopefully someone can shed some light on this problem I'm having. I'm trying to declare a variable to a type of class I've defined (which is a minHeap), but actually instantiate it...
2
by: Derrick | last post by:
How does one declare an event within an interface, so that every class which implements that interface must implement that event? I think I just need to specifiy the actual event as I would a...
0
by: Benjamin Lukner | last post by:
Hi! I'd like to dynamically call API functions from different DLLs, depending on what platform the program runs. Now I'm wondering what the most simple way may be (without meta code and compiler...
0
by: eric | last post by:
Can I declare a pure virtual member function which accepts as input a boost shared pointer to an object of a base class, such that - concrete implementations of the function can redirect the...
23
by: mark.moore | last post by:
I know this has been asked before, but I just can't find the answer in the sea of hits... How do you forward declare a class that is *not* paramaterized, but is based on a template class? ...
2
by: Sam Waller | last post by:
/********************* **********************/ I'm trying to declare a function pointer in class A and set it in class B, but I get syntax errors. How can I get this to compile and run? ...
2
by: freegnu | last post by:
how to declare a friend function that can access two class it will look like the following class A { private: int i; public: A(){} ~A(){} friend void call(A &a, B &b);
3
by: johnmmcparland | last post by:
Hi all, I would like to have a static constant array inside a class definition which would contain the number of days in each month (I am writing a Date class as an exercise). However my...
0
ADezii
by: ADezii | last post by:
The motivation for this Tip was a question asked by one of our Resident Experts, FishVal. The question was: How to Declare Default Method/Property in a Class Module? My response to the question was...
1
by: yu83thang | last post by:
Hi, May I know how to declare a Class in C++ window application form? Below is my code and error as shown below as well. here is my class declaration: ref class CLoadObj { public:
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.