|
-
May 28th, 2017, 08:03 AM
#1
C++ OOP-Revision Question on Class, Data Members, and Member Methods
Having acquired very basic skills in C++, I've started learning Object Oriented Programming in C++ for a week now. I came across a revision question below and got stuck. I feel there are some other details the question expects me to include the coding. I'm still a beginner in as far as C++ structures are concerned, and will appreciate your guidance/assistance on this as I had no other references or examples that could guide me. For any incorrect presentations here or formatting, kindly correct me. I'm still learning. Thanks you.
Question:
Create a C++ program with a class Account
Data members:
1.accountName
2.openBalance
3.deposit
Member methods:
1.getdetails()
2.calculatecurrentbalance()
Code:
<#include<iostream>
using namespace std;
//My first attempt in creating class, data members and member methods..
class Account
getdetails()
calculatecurrentbalance()
// I'm not sure I'm right...and do not know how to continue...I guess I need an intervention on this...
{
char accountName;
double openBalance;
double deposit;{
{Account() {Balance=0.0;}
getdetails()
calculatecurrentbalance()
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|