Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Having acquired basic skills in C++, I've been learning OOP in C++ for a week now, and after successfully writing very simple programs, I got stuck with a question in a revision exercise I came across. I'm still a beginner in as far as C++ structures are concerned, and will appreciate your guidance/assistance on this.

Question:
Create  a C++ program with a class Account
Data members:
1.accountName
2.openBalance
3.deposit

Member methods:
1.getdetails()
2.calculatecurrentbalance()


What I have tried:

<#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...
{
      char accountName;
      double openBalance;
      double deposit;{
{Account() {Balance=0.0;}

}

>
Posted
Updated 27-May-17 4:08am

1 solution

Some useful tutorials at Classes (I) - C++ Tutorials[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900