Ru-Board.club
← Вернуться в раздел «Прикладное программирование»

» C++ classes

Автор: Voha
Дата сообщения: 19.07.2002 04:35
Narod, pomogite napisat' klass v Visual C++.
------------------------------------------------------
Zadacha takaya:
Po narisovanoy sxeme nado napisat' klass.
Sxema: http://www.ratio.co.uk/white.html -> "Figure 1 - Subset of UML Object Modelling Notation - A Summary"

Odin fail doljen v sebya vklyuchat' sleduyushchiye klassy: Accounts, HeadOffices, BranchOffices, Transactions, CurrentAccounts, SavingsAccounts i Customers.

Dostatocho tol'ko napisat' sami klassy:
class Accounts
{ private: data members // zachem oni nujny;
public: // kakie on funkcyi ispol'zuet i nadpisat' tol'ko chto kajdaya funkcyya doljna delat'
};
class HeadOffices
{
...
}

i t.d.
________________________________
BOLSHOE chelovecheskoe SPASIBO!

P.S. Ya uje chto-to napisal, no ne uveren v pravelnosti napisanogo....
esli kto znaet navernyaka, to popravte pls.

Добавлено
//***********************************************
// Accounts Class

#ifndef ACCOUNTS_H_
#define ACCOUNTS_H_

class Accounts
{
private:
SavingsAccount SvngAcc; // this gives acces to SavingsAccount class

CurrentAccount CurrAcc;// this gives acces to CurrentAccount class
Transactions transact; // makes transaction possible

public:
Accounts();// default constructor
double CalcCharges(SavingsAccount SvngAcc, const Transactions transact); //
void PrintStatement(?) const;// Prints statement
~Accounts();// destructor
};

#endif

//-----------------------------------------------
// Transactions Class

#ifndef TRANSACTIONS_H_
#define TRANSACTIONS_H_

class Transactions
{
private:
double transfered_money;// Amount of money to transfer
//Accounts Acc;

public:
Transactions();// default constructor
Transactions(double trnsf_money, ) const;//
debitFrom(Accounts Acc, const double trnsf_money);
CreditTo(Accounts Acc, const double trnsf_money);
~Transactions();// destructor
};

#endif

//-----------------------------------------------
// BranchOffices Class

#ifndef BRANCH_OFFICES_H_
#define BRANCH_OFFICES_H_

class BranchOffices
{
private:
Accounts Acc;
struct branch_address// Structure that reprisents
{// the address of the branch of the bank

char number_and_street; // Number and street
int zip_code; // zip code
char city[10];// City
char state[2];//State (two letters)
};

struct manager_name//
{// Structure that reprisents manager's first and last names

char firstName[10]; char lastName[10];
};

public:
BranchOffices();// default constructor
void BranchOffices(Accounts Acc, branch_address brnAddr, manager_name mngrName);// Will initialize the address of the bank's branch and manager's name
~BranchOffices();// destructor
};

#endif

//-----------------------------------------------
// CurrentAccounts Class

#ifndef CURRENT_ACCOUNTS_H_
#define CURRENT_ACCOUNTS_H_

class CurrentAccounts
{
private:
double moneyOnCurrentAccount;

public:
CurrentAccounts();// default constructor
? calcCarges(?);
~CurrentAccounts();// destructor
};

#endif

//-----------------------------------------------
// Customers Class

#ifndef CUSTOMERS_H_
#define CUSTOMERS_H_

class Customers
{
private:
struct customer_address // Structure that reprisent the customer's address
{

char number_and_street;// Number and street
int zip_code; // zip code
char city[10];// City
char state[2];// State (two letters)
};

struct customer_name
{// Structure that reprisents customer's first and last names

char firstName[10]; char lastName[10];
};

public:
Customers();// default constructor
void Customers(customer_address custAddr, customer_name custName);// Will initialize the customer's address and name
~Customers();// destructor
};

#endif

//------------------------------------------------
// SavingsAccounts Class

#ifndef SAVINGS_ACCOUNTS_H_
#define SAVINGS_ACCOUNTS_H_

class SavingsAccounts
{
private:
double moneyOnSavingsAccount; // Amount of money on customer's saving's account

public:
SavingsAccounts();// default constructor
? calcCarges(?);
~SavingsAccounts();// destructor
};

#endif

//-------------------------------------------------
// HeadOffices Class

#ifndef HEAD_OFFICES_H_
#define HEAD_OFFICES_H_

class HeadOffices
{
private:
BranchOffices Brnch_Office;
struct bank_address// Structure that reprisents
{// the address of the bank

char number_and_street[20]; // Number and street
int zip_code; // zip code
char city[10]; // City
char state[2]; // State (two letters)
};//

char bank_name[20];// Bank's official name

public:
HeadOffices();// default constructor
void HeadOffices(BranchOffices Brnch_Office, char bank, bank_addres bankAddr);// Will initialize bank's name and address
~HeadOffices();// destructor
};

#endif

//################################################
// End of Banking.h Class

Страницы: 1

Предыдущая тема: How tracing messages of any window in Delhi


Форум Ru-Board.club — поднят 15-09-2016 числа. Цель - сохранить наследие старого Ru-Board, истории становления российского интернета. Сделано для людей.