niusouti.com

I'm sorry, your car must be out of use at the moment for one month(翻译)

题目

I'm sorry, your car must be out of use at the moment for one month(翻译)


相似考题

4.使用VC++6.0打开考生文件夹下的源程序文件3.cpp,其中定义了用于表示日期的类Date,但类Date的定义并不完整,按要求完成下列操作,将类的定义补充完整。 (1)定义私有成员变量year、month、day。分别表示年、月、日,类型为int。请在注释1后添加适当的语句。 (2)完成构造函数,分别给year、month、day赋值,请在注释2后添加适当的语句。 (3)完成重载符号“十=”的定义,请在注释3后添加适当的语句。 (4)完成print打印函数,输出到屏幕和文件的格式相同,请在注释4后添加适当的语句。 注意:仅在函数指定位置添加语句,请勿改动主函数main与其他函数中的任何内容。 程序正常运行,输出的结果为2008年11月813。 试题程序: include(iostream.h) include(fstream) include(iomanip) include<cmath) usingnamespacestd; voidWriteFile(intc) { ofstreamout1; out1.open("3.txt",ios_base::app); out1<<C<<; out1.close; } voidWriteFile(char*str) { ofstreamoutl; out1.open("3.txt",ios_base::app); out1<<str; out1.close; } voidClearFile { ofstreamout1; out1.open("3.txt"); out1.close; } classDate { public: Date(inty,intm,intd) { //********1******** } voidprint; //********2******** { month+=m; inti=month/12: intj=month%12; if(j==0) {year+=(i-1); month=12; } else { year+=i: month=j; } return*this; } private: //********3******** }; voidDate::print { //********4******** WriteFile(year): WriteFile("年"); WriteFile(month); WriteFile("月"); WriteFile(day); WriteFile("日"); } intmain { ClearFile; DateOly_day(2008,8,8); Olyday+=3: Oly_day.print; return0; }

更多“I'm sorry, your car must be out of use at the moment for one month(翻译) ”相关问题
  • 第1题:

    I’m sure he ____not mind your going with me.

    A.shall

    B. can

    C.would

    D. must


    正确答案:C

  • 第2题:

    编译和执行以下代码,输出结果是( )。 int i=1; switch (i) { case 0: System.out.print("zero,"); break; case 1: System.out.print("one,"); case 2: System.out.print("two,"); default: System.out.println("default"); }

    A.one,

    B.one,two,

    C.one,two,default

    D.default


    正确答案:C

  • 第3题:

     W: Hey, if you can’t enjoy the music at a sensible volume, why not use earphones? I’m preparing for the speech contest.

    M: Oh, sorry. I didn’t realize I’ve being bothering you all this time.

    Q: What is the man probably doing?

    短语怎么回答


    是听力吧?这样我做不了。

     

  • 第4题:

    下面程序的输出结果是( )。 public class Sun { public static void main(String args[ ]) { int i = 1; switch (i) { case 0: System.but.println("zero"); break; case 1: System.out.println("one"); case 2: System.out.println("two"); default: System.out.println ("default"); } } }

    A.one

    B.one, default

    C.one, two, default

    D.default


    正确答案:C
    解析:该题考查对switch-case-break的理解。每个分支语句后面必须有break语句,否则程序向下执行,直到遇到break语句或程序结束。所以,该题i=1时执行casel分支语句,而casel分支语句后没有break语句,程序继续向下执行case2分支语句和 default分支语句。A只执行了case 1:B只执行了casel和default;C:只执行了default。故本题的正确答案是C。

  • 第5题:

    下面程序的输出结果是( )。 Public class Sun { public static void main(String args[ ]) { int i = 9; switch (i) { default: System.out.println("default"); case 0: System.out.println("zero"); break; case 1: System.out.println("one"); case 2: System.out.println("two"); } } }

    A.default

    B.defauolt, zero

    C.error default clause not defined

    D.no output displayed


    正确答案:B
    解析:该题考查对switch-case-break的理解。每个分支语句后面必须有break语句,否则程序向下执行,直到遇到break语句或程序结束。所以该题i=9时没有匹配的case语句,执行 default分支语句,而default分支语句后没有 break语句,程序继续向下执行case 0分支语句,Case0分支语句后有break语句程序结束。故本题答案是B。

  • 第6题:

    --Can I get the house cheaper?
    --Sorry, it's ______ my power to sell it any cheaper.

    A. without
    B. except
    C. beyond
    D. out

    答案:C
    解析:
    beyond one's power是固定搭配,表示"超出某人的能力",故选C。