application.cpp

来自「c++编程宝典源码及Quincy99编译器 是《标准C++编程宝典》电子工业出」· C++ 代码 · 共 50 行

CPP
50
字号
////////////////////////////////////////
// File Name: Application.cpp
////////////////////////////////////////
#include <iostream>
#include <Application.h>

////////////////////////////////////////
// The string ReadData() function.
////////////////////////////////////////
void Application::ReadData(std::string& str,
    const std::string& prompt)
{
    std::cout << prompt << ": ";
    std::getline(std::cin, str);
}

////////////////////////////////////////
// The Date ReadData() function.
////////////////////////////////////////
void Application::ReadData(Date& date,
    const std::string& prompt)
{
    std::cout << prompt << " (mm dd yy): ";
    std::cin >> date;
}

////////////////////////////////////////
// The Money ReadData() function.
////////////////////////////////////////
void Application::ReadData(Money& money,
    const std::string& prompt)
{
    double mn;
    std::cout << prompt << ": ";
    std::cin >> mn;
    money = mn;
}

////////////////////////////////////////
// The SSN ReadData() function.
////////////////////////////////////////
void Application::ReadData(SSN& ssn,
    const std::string& prompt)
{
    long sn;
    std::cout << "SSN: ";
    std::cin >> sn;
    ssn = SSN(sn);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?