All pastes #383010 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-03-06 01:49 UTC
rendered paste body
#include <iostream>
using namespace std;


int NumShares = 0;
double SalePrice = 0;
double PurchasePrice = 0;
double SaleCom = 0;
double PurchaseCom = 0;
double TradeProfit = 0;
double OverallProfit = 0;

double Get_NumShares();

int main()
{
}

double Get_NumShares()
{
    int NumShares = 0;
    do
    {
    cout << "What is the share price? ";  
    cin >> SalePrice;  
        if (SalePrice < 0)  
        cout << "Sale price must be > 0.";   
    } while (NumShares == 0);
        return NumShares;
};

double Get_SalePrice()
{
    double SalePrice = 0;
    do
    {
    cout << "What is the share price? ";
    cin >> SalePrice;
        if (SalePrice < 0)
        cout << "Sale price must be > 0.";
    } while (SalePrice == 0);
        return SalePrice;
};

double Get_SaleCom();
{
       double SaleCom;
       do
       {
           cout << "What is the sales commission? ";
           cin >> SaleCom;
                if (SaleCom <= 0)
                cout << "Sale commission mus be >= 0. ";
       } while (SaleCom == 0);
        return SaleCom;
};