整专业资料
微信QQ群
考生网QQ群

群号:517231281

扫码加群
点击二维码加群

考生网微信公众号

微信号:zikaosw

课程试听
最新资讯

手机端访问

1、直接输入www.zikaosw.cn
2、扫描左侧二维码

登录 | 注册
登录/注册后,可享受
  • 课程免费试听
  • 试做在线题库
  • 学习提升指导
  • [主观题] 【程序分析题】#include
    using namespace std;class Time
    public:
    Time(int h,int m){hours=h;minutes=m;}void Time120;
    friend void Time24(Time time);private:int hours,minutes;
    };
    void Time::Time120{
    if(hours>12)cout<<hours-12<<":"<<minutes<<"PM=-";elsecout<<hours<<;"<<minutes<<"AM==";
    }
    void Time24(Time time){cout<<time.hours<<":"<<time.minutes<<"In";}int main)
    {
    Time T1(23,30),T2(10,45);T1.Time120;
    Time24(T1);T2.Time120;Time24(T2);
    }
    【原题如下】

     纠错    

  • 助考班推荐

您可能感兴趣的试题

  • 1、[填空题]若有声明“templateclass Tclass{/*...*/};”,用语句“Tclass Tobj;”建立一个Tclass对象,则该语句出错的原因是______。

  • 2、[填空题]利用“对象名.成员变量”形式访问的对象成员,仅限于类中声明为公有的成员,若要访问其他成员变量,需要通过______或者公有成员函数。

  • 3、[填空题]静态成员函数对于每个类来说只有一份代码,所有对象共享这份代码,所以静态成员函数不能是______。

  • 4、[主观题]【程序分析题】#include
    #includeusing namespace std;int main)
    double x=10.456;
    cout<cout<<"10(十六)="<cout.setf(ios:-scientific);cout<return 0;
    【原题如下】

  • 5、[主观题]【程序填空题】以下程序输出name:D Class Derived=80,请将程序补充完整。
    #include
    using namespace std;class Base
    public:
    Base(const char*na){strcpy(name,na);}};
    class __(2)
    public:
    Derived(const char*nm):Base(nm){}
    void show(;
    };
    void Derived::show({cout<<"name:"<Derived d1(""D");d1.show(;
    cout<<"Class Derived="<【原题如下】

Copyright © 2010 - 2023 湖南求实创新教育科技有限公司 All Right Reserved.

温馨提示:如您需要的资料本网暂时没有,请于工作日08:00-18:00,点击这里,联系客服及时补充资料。